Upgrade to ExtJS 4.0.2 - Released 06/09/2011
[extjs.git] / docs / app / view / cls / TabPanel.js
diff --git a/docs/app/view/cls/TabPanel.js b/docs/app/view/cls/TabPanel.js
new file mode 100644 (file)
index 0000000..316a494
--- /dev/null
@@ -0,0 +1,26 @@
+/**
+ * The documentation panel.
+ * TODO: Source code tab, Examples, Q&A
+ */
+Ext.define('Docs.view.cls.TabPanel', {
+    extend: 'Ext.tab.Panel',
+    alias: 'widget.classtabpanel',
+    requires: [
+        'Docs.view.cls.Overview'
+    ],
+
+    plain: true,
+
+    // Remember tab scroll position on Webkit
+    listeners: {
+        beforetabchange: function(tabPanel, newCard, oldCard) {
+            oldCard.prevScroll = oldCard.body.getScroll()['top'];
+        },
+        tabchange: function(tabPanel, newCard, oldCard) {
+            if (newCard.prevScroll) {
+                newCard.body.scrollTo('top', newCard.prevScroll);
+            }
+        }
+    }
+
+});