MainController.js 904 B

1234567891011121314151617181920212223242526
  1. /**
  2. * This class is the controller for the main view for the application. It is specified as
  3. * the "controller" of the Main view class.
  4. */
  5. Ext.define('saas.view.main.MainController', {
  6. extend: 'Ext.app.ViewController',
  7. alias: 'controller.main',
  8. onToggleNavigationSize: function () {
  9. var me = this,
  10. refs = me.getReferences(),
  11. navigationList = refs.navigationTreeList,
  12. navCollapsed = !navigationList.navCollapsed,
  13. new_width = navCollapsed ? 64 : 160,
  14. ope = navCollapsed ? 'addCls' : 'removeCls';
  15. refs.mainLogo.animate({dynamic: true, to: {width: new_width}});
  16. navigationList.body.animate({dynamic: true, to: {width: new_width}});
  17. navigationList.animate({dynamic: true, to: {width: new_width}});
  18. navigationList.el[ope]('nav-collapsed');
  19. navigationList.navCollapsed = navCollapsed;
  20. }
  21. });