Skip to content

Instantly share code, notes, and snippets.

@swarnendude
Last active December 16, 2015 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swarnendude/5481361 to your computer and use it in GitHub Desktop.
Save swarnendude/5481361 to your computer and use it in GitHub Desktop.
Slidenav - controller
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