X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/df248fcadb1956e5027424ab9e59c41ddd96d3bd..e5ddc7a08a1464b59075e435c959cd957238fabd:/views/tabs/tabs.js?ds=sidebyside diff --git a/views/tabs/tabs.js b/views/tabs/tabs.js index dcd3e96..43df1c1 100644 --- a/views/tabs/tabs.js +++ b/views/tabs/tabs.js @@ -29,8 +29,13 @@ define([ } if(this.options.stacked) { - this.nodes.tabBar.addClass('nav-stacked nav-pills'); + this.nodes.tabBar.addClass('nav-stacked nav-pills').removeClass('nav-tabs'); } + if(this.options.position === 'right') { + this.$el.addClass('tabs-right'); + this.nodes.content.addClass('tab-content'); + } + return this; }, addTab: function(title, slug, content) { @@ -56,11 +61,20 @@ define([ this.nodes.tabBar.find('.active').removeClass('active'); this.nodes.tabBar.find('a[href="#'+slug+'"]').parent().addClass('active'); + var prevSlug = this.selectedTab; this.selectedTab = slug; - this.trigger('tabSelected', slug); + this.trigger('tabSelected', {slug: slug, prevSlug: prevSlug}); } }, + getAsView: function() { + return this.$el; + }, + + getCurrentSlug: function() { + return this.selectedTab; + }, + /* Events */ _onTabTitleClicked: function(e) {