Moving data.js to its own module directory
[fnpeditor.git] / views / tabs / tabs.js
index c4d7697..de776c6 100644 (file)
@@ -29,7 +29,7 @@ define([
             }\r
             \r
             if(this.options.stacked) {\r
-                this.nodes.tabBar.addClass('nav-stacked nav-pills');\r
+                this.nodes.tabBar.addClass('nav-stacked nav-pills').removeClass('nav-tabs');\r
             }\r
             return this;\r
         },\r
@@ -57,8 +57,9 @@ define([
                 this.nodes.tabBar.find('.active').removeClass('active');\r
                 this.nodes.tabBar.find('a[href="#'+slug+'"]').parent().addClass('active');\r
                 \r
+                var prevSlug = this.selectedTab;\r
                 this.selectedTab = slug;\r
-                this.trigger('tabSelected', slug);\r
+                this.trigger('tabSelected', {slug: slug, prevSlug: prevSlug});\r
             }\r
         },\r
         \r
@@ -66,6 +67,10 @@ define([
             return this.$el;\r
         },\r
         \r
+        getCurrentSlug: function() {\r
+            return this.selectedTab;\r
+        },\r
+        \r
         /* Events */\r
         \r
         _onTabTitleClicked: function(e) {\r