Last active
February 23, 2018 18:52
-
-
Save dhindurthy/405452476bc8ab10420630661adb72b7 to your computer and use it in GitHub Desktop.
contextual-tabs
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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
ariaRole: 'tablist', | |
tabList:[], | |
actions:{ | |
clickOnTab: function(tab){ | |
this.sendAction('clickOnTab', tab); | |
let tabList = this.get('tabList'); | |
for(var i=0;i<tabList.length;i++){ | |
this.$('#'+tabList[i].id).removeClass('active'); | |
if(tabList[i].id === tab.id){ | |
this.$('#'+tabList[i].id).addClass('active'); | |
} | |
} | |
} | |
} | |
}); |
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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
classNames:['cx-tabpanel'], | |
idOfpanel:'', | |
ariaRole: 'tabpanel', | |
didReceiveAttrs() { | |
this.set('isVisible', false); | |
if(this.get('idOfpanel')===this.get('activeTabAsPerTabToPanel')){ | |
this.set('isVisible', true); | |
} | |
}, | |
click: function() { | |
this.sendAction('clickOnPanel', this.get('idOfpanel')); | |
} | |
}); |
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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
activeTabAsPerTabs:'inse', | |
actions:{ | |
changePanel: function(tab){ | |
let tabList = this.get('tabList'); | |
for(var i=0;i<tabList.length;i++){ | |
if(tabList[i].id === tab.id){ | |
this.set("activeTabAsPerTabs",tab.id); | |
} | |
} | |
}, | |
clickOnPanel: function(idOfpanel) { | |
/** click in any panel is reported here with the idOfpanel**/ | |
} | |
} | |
}); |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
listOfTabs: [{ | |
"name":"Animals", | |
"id":"anim" | |
},{ | |
"name":"Birds", | |
"id":"bird" | |
},{ | |
"name":"Fish", | |
"id":"fish" | |
},{ | |
"name":"Insects", | |
"id":"inse" | |
}] | |
}); |
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
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
}); |
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
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
font-family:"Comic Sans MS", cursive, sans-serif; | |
} | |
ul { | |
list-style-type: none; | |
padding:0 5px 5px 5px; | |
padding: 0; | |
} | |
li { | |
display: inline; | |
padding:0 5px 5px 5px; | |
border-bottom: 3px solid gray; | |
transition: 0.5s ease; | |
cursor: pointer; | |
} | |
.cx-tabpanel { | |
padding:0 8px 8px 8px; | |
} | |
li.active { | |
border-bottom: 3px solid #F08080; | |
background-color:#77EDF4; | |
transition: 0.5s ease; | |
color:#5D6D7E; | |
} |
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
{ | |
"version": "0.13.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.16.2", | |
"ember-template-compiler": "2.16.2", | |
"ember-testing": "2.16.2" | |
}, | |
"addons": { | |
"ember-data": "2.16.3" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment