X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/039112897b09b05153d79ca9a2d9ed114827d294..5e942ab9a9a217a8482a324c3e61fdd83c1c4247:/redakcja/static/js/catalogue/catalogue.js diff --git a/redakcja/static/js/catalogue/catalogue.js b/redakcja/static/js/catalogue/catalogue.js index cb96d113..796e3e8b 100755 --- a/redakcja/static/js/catalogue/catalogue.js +++ b/redakcja/static/js/catalogue/catalogue.js @@ -36,8 +36,8 @@ weekStart: 1, onRender: function(date) { return date.valueOf() < now.valueOf() ? 'disabled' : ''; - }, - }).on('changeDate', function(ev) { + } + }).on('changeDate', function() { checkout.hide(); }).data('datepicker'); }); @@ -47,46 +47,55 @@ var helpdiv = $(this).next(); if (helpdiv.hasClass('help-text')) { var helptext = $("option:selected", this).attr('data-help'); - helpdiv.html($("option:selected", this).attr('data-help') || ''); + helpdiv.html(helptext || ''); } }); // tutorial mode - var tutorial; + var tutorial, tutorial_no; var start; var first_reset = true; function tutreset() { if (start) $(start).popover('hide'); start = null; + tutorial_no = null; var all_tutorial = $('[data-toggle="tutorial"]'); + function sortKey(a) { + return parseInt($(a).attr('data-tutorial')); + } 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} )); if (first_reset) { $.each(tutorial, function(i, e) { - var but = (i < tutorial.length - 1) ? '>>' : 'OK'; + var but = (i < tutorial.length - 1) ? '>>' : 'OK', + but_prev_html = i === 0 ? '' : '<<'; $(e).popover({ title: '×Tutorial', trigger: 'focus', html: 'true', - template: '
' + template: '