Application.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * @Description:
  3. * @Author: hy
  4. * @Date: 2019-08-12 17:59:33
  5. * @LastEditTime: 2019-08-16 15:37:37
  6. */
  7. Ext.define('uas.Application', {
  8. extend: 'Ext.app.Application',
  9. requires: [
  10. 'uas.*'
  11. ],
  12. name: 'uas',
  13. controllers: [
  14. 'Global',
  15. 'Samples'
  16. ],
  17. defaultToken: '',
  18. init: function() {
  19. Ext.tip.QuickTipManager.init(null, {
  20. showOnTap: true
  21. });
  22. if (!Ext.platformTags.test) {
  23. Ext.state.Manager.setProvider(Ext.create('Ext.state.CookieProvider',{
  24. expires: new Date(new Date().getTime()+(1000*60*60*24*30)) //30 days
  25. }));
  26. }
  27. },
  28. launch: function () {
  29. var view = 'uas.view.main.Main';
  30. this.setMainView({
  31. xclass: view
  32. });
  33. },
  34. onAppUpdate: function () {
  35. Ext.Msg.confirm('Application Update', 'This application has an update, reload?',
  36. function (choice) {
  37. if (choice === 'yes') {
  38. window.location.reload();
  39. }
  40. }
  41. );
  42. }
  43. });