fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
translation update
[redakcja.git]
/
redakcja
/
static
/
js
/
catalogue
/
catalogue.js
diff --git
a/redakcja/static/js/catalogue/catalogue.js
b/redakcja/static/js/catalogue/catalogue.js
index
cb96d11
..
fa3f5f2
100755
(executable)
--- a/
redakcja/static/js/catalogue/catalogue.js
+++ b/
redakcja/static/js/catalogue/catalogue.js
@@
-63,10
+63,15
@@
start = null;
var all_tutorial = $('[data-toggle="tutorial"]');
start = null;
var all_tutorial = $('[data-toggle="tutorial"]');
+ function sortKey(a) {
+ return parseInt($(a).attr('data-tutorial'));
+ }
tutorial = $.makeArray(all_tutorial.sort(
tutorial = $.makeArray(all_tutorial.sort(
- function(a, b) {return
$(a).attr('data-tutorial') < $(b).attr('data-tutorial'
) ? -1 : 1}
+ function(a, b) {return
sortKey(a) < sortKey(b
) ? -1 : 1}
));
));
+ console.log($(tutorial[0]).data('popover'));
+ console.log($(tutorial[16]).data('popover'));
if (first_reset) {
$.each(tutorial, function(i, e) {
var but = (i < tutorial.length - 1) ? '>>' : 'OK';
if (first_reset) {
$.each(tutorial, function(i, e) {
var but = (i < tutorial.length - 1) ? '>>' : 'OK';
@@
-86,7
+91,12
@@
function tuton() {
sessionStorage.setItem("tutorial", "on");
tutreset();
function tuton() {
sessionStorage.setItem("tutorial", "on");
tutreset();
- $('#tutModal').modal('show');
+ var $tutModal = $('#tutModal');
+ if($tutModal.length === 0) {
+ tut();
+ } else {
+ $tutModal.modal('show');
+ }
return false;
}
function tutoff() {
return false;
}
function tutoff() {
@@
-112,12
+122,11
@@
}
$('#tutModal').on('hidden.bs.modal', tut);
}
$('#tutModal').on('hidden.bs.modal', tut);
- var $tuton = $("#tuton");
- if (sessionStorage.getItem("tutorial") == "on" && $tuton.length == 0) {
+ if (sessionStorage.getItem("tutorial") == "on" && $('#tuton').length == 0) {
tutreset();
tut();
}
tutreset();
tut();
}
- $
tuton.on('click
', tuton);
+ $
(document).on('click', '#tuton
', tuton);
$(document).on('click', '.tutorial-off', tutoff);
$(document).on('click', '.tutorial-next', tut);
});
$(document).on('click', '.tutorial-off', tutoff);
$(document).on('click', '.tutorial-next', tut);
});