Forgot one file. re #73

This commit is contained in:
Sébastien Lucas 2013-06-25 08:53:38 +02:00
parent e547899584
commit 8833ff06ea

34
util.js
View file

@ -35,19 +35,6 @@ function sendToMailAddress (component, dataid) {
$.ajax ({url: url, type: 'post', data: { data: dataid, email: email }, success: retourMail}); $.ajax ({url: url, type: 'post', data: { data: dataid, email: email }, success: retourMail});
} }
function fancyBoxObject (title, type) {
var out = { prevEffect : 'none', nextEffect : 'none' };
if (isEink) {
out ["openEffect"] = 'none';
out ["closeEffect"] = 'none';
out ["helper"] = { overlay : null };
}
if (title) out ["title"] = title;
if (type) out ["type"] = type;
return out;
}
function strformat () { function strformat () {
var s = arguments[0]; var s = arguments[0];
for (var i = 0; i < arguments.length - 1; i++) { for (var i = 0; i < arguments.length - 1; i++) {
@ -154,16 +141,27 @@ function updatePage (data) {
$.getJSON(jsonurl, function(data) { $.getJSON(jsonurl, function(data) {
data ["const"] = currentData ["const"]; data ["const"] = currentData ["const"];
var detail = templateBookDetail (data); var detail = templateBookDetail (data);
var fancyparams = fancyBoxObject (data.title, null); $.magnificPopup.open({
fancyparams ["content"] = detail; items: {
$.fancybox(fancyparams); src: detail,
type: 'inline'
}
});
debug_log (elapsed ()); debug_log (elapsed ());
}); });
}); });
$(".fancycover").fancybox(fancyBoxObject (null, 'image'));
$(".fancyabout").fancybox(fancyBoxObject ('COPS ' + currentData.const.version, 'ajax')); $('section').magnificPopup({
delegate: '.fancycover', // child items selector, by clicking on it popup will open
type: 'image',
gallery:{enabled:true, preload: [0,2]}
// other options
});
$('.fancyabout').magnificPopup({ type: 'ajax' });
} }
} }