UNPKG

fd-gulp-convert-encoding

Version:

convert file to assigned charset

90 lines (71 loc) 2.17 kB
/** * PurchasingList/物流等的弹出框,全屏的 */ define('detail.lib.pageDialog.PageDialog', ['jQuery', 'Class', 'detail.core.Wing', 'detail.core.Event', 'lofty.ui.Popup'], function($, Class, Wing, Event, Popup) { return Class({ init: function(options) { this.options = { zindex: 95, afterShow: function(){}, afterClose: function(){} }; $.extend(this.options, options); // this.loadModule(); }, loadModule: function(){ var options = this.options, route = 'modules/' + options.module, className = options.module.replace(/([a-z])([A-Z])/g, function(s, m1, m2) { return m1 + '-' + m2; }).toLowerCase(), zindex = options.zindex || 95, that = this; Wing.load(route, { data: { // 'activeType': options.activeType } }).done(function(elm, next) { // 模块渲染执行 $('body').append(elm); $('div.m-detail-' + className).height(document.documentElement.clientHeight); next(); // 弹全屏框 that.popup = new Popup({ zindex: zindex, tpl: '.wing-view-' + options.module, isModal: false }); that.showPopup(); }); }, showDialog: function(){ if (this.popup){ this.showPopup(); } else { this.loadModule(); } }, showPopup: function(){ var that = this; setTimeout(function(){ that.popup.show(); that._hideBodyOverflow(); that.options.afterShow(); }, 200); }, closeDialog: function(){ this.popup.hide(); this._showBodyOverflow(); this.options.afterClose(); }, _hideBodyOverflow: function(){ this.bodyOverflow = $('body').css('overflow'); $('body').css('overflow', 'hidden'); }, _showBodyOverflow: function(){ $('body').css('overflow', this.bodyOverflow); } }); });