浏览代码

yvan-ext-mobile\dist Scope 支持 goBack

lizw 3 年之前
父节点
当前提交
f333fedc41
共有 2 个文件被更改,包括 25 次插入24 次删除
  1. 24 23
      dist/yvan-ext-mobile.js
  2. 1 1
      dist/yvan-ext-mobile.js.map

+ 24 - 23
dist/yvan-ext-mobile.js

@@ -37852,29 +37852,7 @@ define(['exports'], function (exports) { 'use strict';
                               .find('.navbar>.x-panelheader')
                               .find('.x-body-el>.fa-angle-left');
                           $back.off('click');
-                          $back.on('click', function () {
-                              var handle = Ext.Viewport.getActiveItem();
-                              // 显示前一个页面
-                              var index = Scope.SHOW_PAGE_STACK.findIndex(function (scope) { return scope._handle === handle; });
-                              // console.log("###### remove", index)
-                              if (index >= 0) {
-                                  Scope.SHOW_PAGE_STACK.splice(index, 1);
-                              }
-                              var scopeArr = lodash.sortBy(Scope.SHOW_PAGE_STACK, function (scope) { return scope._lastShowTime; });
-                              if (scopeArr.length > 0) {
-                                  var scope = scopeArr[scopeArr.length - 1];
-                                  scope._handle.setStyle({ 'z-index': 1 });
-                                  Ext.Viewport.getLayout().setAnimation({ type: 'slide', direction: 'right', duration: 300 });
-                                  Ext.Viewport.setActiveItem(scope._handle);
-                                  scope._lastShowTime = new Date().getTime();
-                                  // console.log("###### show", (scopeArr.length - 1), Scope.SHOW_PAGE_STACK)
-                              }
-                              // 关闭
-                              handle.setStyle({ 'z-index': 0 });
-                              // Ext.Viewport.getLayout().setAnimation({type: 'slide', direction: 'right', duration: 300})
-                              Ext.Viewport.remove(handle);
-                              handle.close();
-                          });
+                          $back.on('click', function () { return that.goBack(); });
                       }
                   },
                   destroy: function () {
@@ -37912,6 +37890,29 @@ define(['exports'], function (exports) { 'use strict';
           });
           return that._handle;
       };
+      Scope.prototype.goBack = function () {
+          var handle = Ext.Viewport.getActiveItem();
+          // 显示前一个页面
+          var index = Scope.SHOW_PAGE_STACK.findIndex(function (scope) { return scope._handle === handle; });
+          // console.log("###### remove", index)
+          if (index >= 0) {
+              Scope.SHOW_PAGE_STACK.splice(index, 1);
+          }
+          var scopeArr = lodash.sortBy(Scope.SHOW_PAGE_STACK, function (scope) { return scope._lastShowTime; });
+          if (scopeArr.length > 0) {
+              var scope = scopeArr[scopeArr.length - 1];
+              scope._handle.setStyle({ 'z-index': 1 });
+              Ext.Viewport.getLayout().setAnimation({ type: 'slide', direction: 'right', duration: 300 });
+              Ext.Viewport.setActiveItem(scope._handle);
+              scope._lastShowTime = new Date().getTime();
+              // console.log("###### show", (scopeArr.length - 1), Scope.SHOW_PAGE_STACK)
+          }
+          // 关闭
+          handle.setStyle({ 'z-index': 0 });
+          // Ext.Viewport.getLayout().setAnimation({type: 'slide', direction: 'right', duration: 300})
+          Ext.Viewport.remove(handle);
+          handle.close();
+      };
       /**
        * 对话框"保存"成功.
        * 关闭对话框,并响应 success 方法

文件差异内容过多而无法显示
+ 1 - 1
dist/yvan-ext-mobile.js.map