MainTab.js 917 B

12345678910111213141516171819202122232425262728293031323334
  1. import _ from 'lodash'
  2. import $ from 'jquery'
  3. export default function () {
  4. Ext.define('Yvan.MainTab', {
  5. extend: 'Ext.tab.Panel',
  6. xtype: 'maintab',
  7. constructor(config) {
  8. const self = this
  9. const newConfig = _.defaultsDeep({}, config, {
  10. listeners: {
  11. tabchange(tabPanel, newCard, oldCard, eOpts) {
  12. console.log('tabChange')
  13. $(window).trigger('tabChange', {
  14. tabPanel, newCard, oldCard, eOpts
  15. });
  16. if (typeof config.tabchange === 'function') {
  17. config.tabchange.apply(this, arguments)
  18. }
  19. }
  20. }
  21. })
  22. this.superclass.constructor.call(self, newConfig)
  23. },
  24. addScope() {
  25. }
  26. });
  27. }