Created
July 12, 2012 14:32
-
-
Save juandopazo/3098478 to your computer and use it in GitHub Desktop.
Allow HTML in a YUI TabView
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var _queries = Y.TabviewBase._queries, | |
| _classNames = Y.TabviewBase._classNames; | |
| Y.TabView.prototype._renderTabs = function(contentBox) { | |
| var tabs = contentBox.all(_queries.tab), | |
| panelNode = this.get('panelNode'), | |
| panels = (panelNode) ? this.get('panelNode').get('children') : null, | |
| tabview = this; | |
| if (tabs) { // add classNames and fill in Tab fields from markup when possible | |
| tabs.addClass(_classNames.tab); | |
| contentBox.all(_queries.tabLabel).addClass(_classNames.tabLabel); | |
| contentBox.all(_queries.tabPanel).addClass(_classNames.tabPanel); | |
| tabs.each(function(node, i) { | |
| var panelNode = (panels) ? panels.item(i) : null; | |
| tabview.add({ | |
| boundingBox: node, | |
| contentBox: node.one('.' + _classNames.tabLabel), | |
| label: node.one('.' + _classNames.tabLabel).getHTML(), | |
| panelNode: panelNode | |
| }); | |
| }); | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment