vimo-dt
Version:
A Vue2.x UI Project For Mobile & HyBrid
62 lines (44 loc) • 3.2 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _type = require('../../util/type');
var _loading = require('./loading.vue');
var _loading2 = _interopRequireDefault(_loading);
var _GeneratePopUpInstance = require('../../util/GeneratePopUpInstance.js');
var _GeneratePopUpInstance2 = _interopRequireDefault(_GeneratePopUpInstance);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var LoadingInstance = function (_GeneratePopUpInstanc) {
_inherits(LoadingInstance, _GeneratePopUpInstanc);
function LoadingInstance() {
_classCallCheck(this, LoadingInstance);
return _possibleConstructorReturn(this, (LoadingInstance.__proto__ || Object.getPrototypeOf(LoadingInstance)).apply(this, arguments));
}
_createClass(LoadingInstance, [{
key: 'normalizeOptions',
value: function normalizeOptions() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
if ((0, _type.isString)(options)) {
options = { content: options };
}
options.scrollControl = false;
return options;
}
}, {
key: 'isPresentHandled',
value: function isPresentHandled(options) {
return !!options && !options.isH5 && window.VM && window.VM.platform && window.VM.platform.showLoading && window.VM.platform.showLoading(options);
}
}, {
key: 'isDismissHandled',
value: function isDismissHandled() {
return window.VM && window.VM.platform && window.VM.platform.hideLoading && window.VM.platform.hideLoading();
}
}]);
return LoadingInstance;
}(_GeneratePopUpInstance2.default);
exports.default = new LoadingInstance(_loading2.default, 'loadingPortal');