minirefresh.theme.native.min.js
2.43 KB
/*!
* minirefresh v2.0.2
* (c) 2017-2018 dailc
* Released under the MIT License.
* https://github.com/minirefresh/minirefresh
*/
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):e.MiniRefresh=o()}(this,function(){"use strict";var e=function(){function e(e,o){for(var n=0;n<o.length;n++){var t=o[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}return function(o,n,t){return n&&e(o.prototype,n),t&&e(o,t),o}}(),o=MiniRefreshTools.theme.defaults,n=MiniRefreshTools.version,t=MiniRefreshTools.extend,i=MiniRefreshTools.namespace,s={down:{isLock:!0},isUseBodyScroll:!0},r=function(n){function i(e){!function(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}(this,i);var o=t(!0,{},s,e);return function(e,o){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!o||"object"!=typeof o&&"function"!=typeof o?e:o}(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,o))}return function(e,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function, not "+typeof o);e.prototype=Object.create(o&&o.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),o&&(Object.setPrototypeOf?Object.setPrototypeOf(e,o):e.__proto__=o)}(i,o),e(i,[{key:"_initDownWrap",value:function(){var e=this;this.os.dd?dd.ui.pullToRefresh.enable({onSuccess:function(){e.options.down.callback&&e.options.down.callback()},onFail:function(){dd.ui.pullToRefresh.stop()}}):this.os.ejs&&(ejs.nativeUI?ejs.nativeUI.pullToRefresh.enable(function(){e.options.down.callback&&e.options.down.callback()}):ejs.ui&&ejs.ui.pullToRefresh.enable({success:function(){e.options.down.callback&&e.options.down.callback()},error:function(){ejs.ui.pullToRefresh.stop()}}))}},{key:"endDownLoading",value:function(){this.os.dd?dd.ui.pullToRefresh.stop():this.os.ejs&&(ejs.nativeUI?ejs.nativeUI.pullToRefresh.stop():ejs.ui.pullToRefresh.stop()),this.options.down.isAutoResetUpLoading&&this.resetUpLoading()}},{key:"_pullHook",value:function(){}},{key:"_downLoaingHook",value:function(){}},{key:"_downLoaingSuccessHook",value:function(){}},{key:"_downLoaingEndHook",value:function(){}},{key:"_cancelLoaingHook",value:function(){}},{key:"_lockDownLoadingHook",value:function(){}}]),i}();return r.sign="native",r.version=n,i("theme.natives",r),r});