Commit a4d492b5 authored by Curtis Adam's avatar Curtis Adam

Readd lightbox to card images

parent f4b64a6a
......@@ -68,3 +68,4 @@ google-config-ui@1.0.0
twitter-config-ui@1.0.0
mizzao:accounts-testing
dynamic-import@0.1.3
czbaker:lightbox2
......@@ -36,6 +36,7 @@ cfs:http-methods@0.0.32
check@1.2.5
coffeescript@1.12.7_3
coffeescript-compiler@1.12.7_3
czbaker:lightbox2@2.7.1_1
ddp@1.3.1
ddp-client@2.1.3
ddp-common@1.2.9
......
......@@ -137,7 +137,8 @@ export function setLightBoxes(content) {
$(element).find('img').each(function () {
var imageTitle = $(this).attr('alt');
var imageUrl = $(this).attr('src');
var wrapped = $(this).wrap('<div class="card-image"><a href="' + imageUrl + '" class="lightbox-img" title="' + imageTitle + '" target="_blank"></a></div>').parent().prop('outerHTML');
$(this).attr('data-type', 'cardImage');
var wrapped = $(this).wrap('<div class="card-image"><a href="' + imageUrl + '" class="lightbox-img" title="' + imageTitle + '" target="_blank" data-lightbox="' + imageUrl + '"></a></div>').parent().prop('outerHTML');
$(this).text(wrapped);
});
......
......@@ -583,13 +583,10 @@ Template.flashcards.events({
turnFront();
},
"click .box": function (evt) {
if (!isMemo() && ($(evt.target).data('type') !== "showHint")) {
if (!isMemo() && ($(evt.target).data('type') !== "showHint") && ($(evt.target).data('type') !== "cardImage")) {
turnCard();
}
},
'click .item.active .block a': function (evt) {
evt.stopPropagation();
},
"click #showHint": function (evt) {
Session.set('selectedHint', $(evt.target).data('id'));
},
......
......@@ -300,6 +300,7 @@ img.cardside {
max-width: 375px;
position: static;
display: block;
z-index: 20;
}
.emojiImage {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment