X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/0add3b13ce4ef42557d9ca33342a159b80a4f42f..fd01330786845fedb31dd93439bf8b1c82cd56c6:/modules/tabsManager.js diff --git a/modules/tabsManager.js b/modules/tabsManager.js index 56d647d..4103887 100644 --- a/modules/tabsManager.js +++ b/modules/tabsManager.js @@ -3,7 +3,7 @@ rng.modules.tabsManager = function(sandbox) { var $ = sandbox.$; var view = $(sandbox.getTemplate('main')()); - + var currentSlug; var tabContent = {}; function selectTab(slug) { @@ -25,6 +25,7 @@ rng.modules.tabsManager = function(sandbox) { if(prevSlug) tabContent[prevSlug].detach(); tabContent[slug].appendTo(view.find('#rng-tabsManager-content')); + currentSlug = slug; } @@ -46,6 +47,9 @@ rng.modules.tabsManager = function(sandbox) { view.find('#rng-tabsManager-tabBar').append(sandbox.getTemplate('tabHandle')({title: title, slug: slug})); if(_.values(tabContent).length === 1) selectTab(slug); + }, + getCurrentSlug: function() { + return currentSlug; } }