X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/9088c2ab96934ee0318e55dadf3573f3325201ff..5e64f92aabe77137fde16fa8aab604fe1fce5f62:/views/tabs/tabs.js?ds=sidebyside diff --git a/views/tabs/tabs.js b/views/tabs/tabs.js index c4d7697..43df1c1 100644 --- a/views/tabs/tabs.js +++ b/views/tabs/tabs.js @@ -29,7 +29,11 @@ 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; }, @@ -57,8 +61,9 @@ 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}); } }, @@ -66,6 +71,10 @@ define([ return this.$el; }, + getCurrentSlug: function() { + return this.selectedTab; + }, + /* Events */ _onTabTitleClicked: function(e) {