X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/5913c54d19b8f6775633176032161d49f9b2f1aa..2dd4071b8858c9727ee3e2c09b73b1eadef6e31e:/src/redakcja/static/js/wiki/loader_readonly.js diff --git a/src/redakcja/static/js/wiki/loader_readonly.js b/src/redakcja/static/js/wiki/loader_readonly.js index a859ec69..2d311239 100644 --- a/src/redakcja/static/js/wiki/loader_readonly.js +++ b/src/redakcja/static/js/wiki/loader_readonly.js @@ -23,12 +23,12 @@ $(function() /* * TABS */ - $('#tabs li').live('click', function(event, callback) { + $(document).on('click', '#tabs li', function(event, callback) { event.preventDefault(); $.wiki.switchToTab(this); }); - $('#tabs li > .tabclose').live('click', function(event, callback) { + $(document).on('click', '#tabs li > .tabclose', function(event, callback) { var $tab = $(this).parent(); if($tab.is('.active')) @@ -72,22 +72,8 @@ $(function() /* Load configuration */ $.wiki.loadConfig(); - var initAll = function(a, f) { - if (a.length == 0) return f(); - - $.wiki.initTab({ - tab: a.pop(), - doc: CurrentDocument, - callback: function(){ - initAll(a, f); - } - }); - }; - - - /* - * Initialize all perspectives - */ - initAll( $.makeArray($('ol#tabs li')), initialize); - console.log(location.hash); -}); \ No newline at end of file + $('.tabs li').each((i, e) => { + $.wiki.initTab({tab: e, doc: CurrentDocument}); + }); + initialize(); +});