Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#74] Loading the picture in a modal with Zurb #110

Merged
merged 3 commits into from
Jan 26, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 32 additions & 5 deletions static/smile-iqmanager.html
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ <h5>Overview</h5>
<td data-bind="text: O3">TV</td>
<td data-bind="text: O4">Floor</td>
<td data-bind="text: A">3</td>
<td><!-- <a class="tiny button" href="#" onclick="alert('No Images Available'); return false;"><img src="images/photo-icon.png" /></a> --><img data-bind="attr: { src: PICURL}" /></td>
<td><a class="reveal-link tiny button" href="#" data-reveal-id="myModal" data-reveal><img src="images/photo-icon.png" /></a><input type="hidden" name="hidden_picurl" data-bind="attr: { value: PICURL}" /></td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -366,7 +366,7 @@ <h5 data-bind="text: title">Title</h5>
<td data-bind="text: O3">Olive Elementary 5th Grade</td>
<td data-bind="text: O4">Olive Elementary 5th Grade</td>
<td data-bind="text: A"></td>
<td><!--a class="tiny button" href="#" onclick="alert('No Images Available'); return false;"><img src="images/photo-icon.png" /></a--><img data-bind="attr: { src: PICURL}" /></td>
<td><a class="reveal-link tiny button" href="#" data-reveal-id="myModal" data-reveal><img src="images/photo-icon.png" /><input type="hidden" name="hidden_picurl" data-bind="attr: { value: PICURL}" /></a><input type="hidden" name="hidden_picurl" data-bind="attr: { value: PICURL}" /></td>
</tr>
</tbody>
</table>
Expand All @@ -383,6 +383,7 @@ <h4 class="subheader">Confirm deletion of this IQSet?</h4>
<input type="button" id="dialog1-yes" value="Delete" />
<input type="button" id="dialog1-no" value="Cancel" />
</div>

</section>
<!-- section#iqset-detail-section -->
<!-- div: row -->
Expand All @@ -400,7 +401,6 @@ <h4 class="subheader">Confirm deletion of this IQSet?</h4>
</div>
<!-- div.section-container -->

<!-- Included JS Files -->
<!-- Included JS Files -->
<script>
/* document.write('<script src=' +
Expand Down Expand Up @@ -437,9 +437,36 @@ <h4 class="subheader">Confirm deletion of this IQSet?</h4>
<script type='text/javascript' src='js/jquery.blockUI-2.66.0.js'></script>
<script type="text/javascript" src="js/rating.js"></script>
<script type="text/javascript" src="js/jquery.fineuploader-3.5.0.min.js"></script>

<!-- Modal to display the picture -->
<div id="myModal" class="reveal-modal" data-reveal>
<img id="modalImg" src=""></img>
<a class="close-reveal-modal">&#215;</a>
</div>
<script>
// jQuery.noConflict();
$(document).foundation();
// jQuery.noConflict();

// initialize foundation
$(document).foundation();

// Opening picture in modal
$("body").on("click", 'a.reveal-link', function(){

// We load the url in the reveal/modal to display the image
var picurl = $(this).parent().find("input[name=hidden_picurl]").attr('value');
$('#modalImg').attr('src',picurl);

// Open modal
$('#myModal').foundation('reveal', 'open');
});

// Closing modal
$("body").on("click", 'a.close-reveal-modal', function(){

$('#modalImg').attr('src','');
$('#myModal').foundation('reveal', 'close');
$('.reveal-modal-bg').attr('style','');
});
</script>
</body>
</html>