Last active
December 16, 2015 18:59
-
-
Save swarnendude/5481361 to your computer and use it in GitHub Desktop.
Slidenav - controller
This file contains 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
Ext.define('SlideNav.controller.App', { | |
extend: 'Ext.app.Controller', | |
config: { | |
refs: { | |
main: 'main', | |
navigation: 'navigation', | |
navBtn: 'button[name="nav_btn"]' | |
}, | |
control: { | |
navBtn: { | |
tap: 'toggleNav' | |
}, | |
navigation: { | |
itemtap: function (list, index, target, record) { | |
this.toggleNav(); | |
} | |
} | |
} | |
}, | |
/** | |
* Toggle the slide navogation view | |
*/ | |
toggleNav: function () { | |
var me = this, | |
mainEl = me.getMain().element; | |
if (mainEl.hasCls('out')) { | |
mainEl.removeCls('out').addCls('in'); | |
} else { | |
mainEl.removeCls('in').addCls('out'); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment