fastman2 2.9.0 → 3.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/actionsheetman.js +96 -1
- package/alertman.js +79 -1
- package/annotationman.js +2912 -17
- package/baseman.js +115 -1
- package/blankpageman.js +171 -1
- package/cascadepickerman.js +322 -1
- package/confirmman.js +87 -1
- package/coreman.js +2182 -3
- package/cryptoman.js +8931 -2
- package/datetimepickerman.js +181 -1
- package/domman.js +2759 -1
- package/eventemitterman.js +112 -1
- package/fileuploadman.js +2970 -1
- package/formvalidateman.js +335 -1
- package/jsbridgeman.js +992 -1
- package/lazyloadman.js +133 -1
- package/loadingman.js +81 -1
- package/modalman.js +264 -1
- package/mutationobserverman.js +356 -1
- package/package.json +1 -1
- package/passguardman.js +1722 -1
- package/persistman.js +60 -1
- package/pickerman.js +680 -1
- package/popupman.js +61 -1
- package/postman.js +1649 -1
- package/preloadman.js +8760 -2
- package/resultpageman.js +153 -1
- package/routerman.js +1201 -1
- package/scrollman-infiniteRefresh.js +117 -1
- package/scrollman-pullDownRefresh.js +302 -1
- package/scrollman.js +2567 -2
- package/storeman.js +585 -1
- package/swiperman.js +4702 -1
- package/swiperoldman.js +3005 -1
- package/tabman.js +145 -1
- package/tipman.js +110 -1
- package/toastman.js +78 -1
- package/toolman.js +22 -1
- package/whenman.js +774 -1
- package/wsman.js +7624 -1
package/lazyloadman.js
CHANGED
|
@@ -1 +1,133 @@
|
|
|
1
|
-
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory();
|
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
|
5
|
+
define([], factory);
|
|
6
|
+
else if(typeof exports === 'object')
|
|
7
|
+
exports["fastman"] = factory();
|
|
8
|
+
else
|
|
9
|
+
root["fastman"] = factory();
|
|
10
|
+
})(this, function() {
|
|
11
|
+
return webpackJsonpfastman([14],{
|
|
12
|
+
|
|
13
|
+
/***/ 233:
|
|
14
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
15
|
+
|
|
16
|
+
module.exports = __webpack_require__(98);
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
/***/ }),
|
|
20
|
+
|
|
21
|
+
/***/ 98:
|
|
22
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
23
|
+
|
|
24
|
+
"use strict";
|
|
25
|
+
/* WEBPACK VAR INJECTION */(function(global) {
|
|
26
|
+
|
|
27
|
+
Object.defineProperty(exports, "__esModule", {
|
|
28
|
+
value: true
|
|
29
|
+
});
|
|
30
|
+
exports.LazyLoad = undefined;
|
|
31
|
+
|
|
32
|
+
var _inViewPort = __webpack_require__(51);
|
|
33
|
+
|
|
34
|
+
var _inViewPort2 = _interopRequireDefault(_inViewPort);
|
|
35
|
+
|
|
36
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
|
+
|
|
38
|
+
var LazyLoad = function LazyLoad(_ref) {
|
|
39
|
+
var _ref$container = _ref.container,
|
|
40
|
+
container = _ref$container === undefined ? '.page-group' : _ref$container,
|
|
41
|
+
_ref$offset = _ref.offset,
|
|
42
|
+
offset = _ref$offset === undefined ? 333 : _ref$offset,
|
|
43
|
+
_ref$src = _ref.src,
|
|
44
|
+
src = _ref$src === undefined ? 'data-src' : _ref$src;
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
actions: {
|
|
48
|
+
lazyLoad: {
|
|
49
|
+
refresh: function refresh(_) {
|
|
50
|
+
// 查看浏览器是否支持MutationObserver特性
|
|
51
|
+
var supportsMutationObserver = typeof global.MutationObserver === 'function';
|
|
52
|
+
|
|
53
|
+
var $pageContent = $(container);
|
|
54
|
+
// 获取容器内所有的图片集合
|
|
55
|
+
var items = $pageContent.find('img');
|
|
56
|
+
|
|
57
|
+
// 占位图片 1px 透明图
|
|
58
|
+
var placeholderSrc = 'data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==';
|
|
59
|
+
|
|
60
|
+
if (items && items.length > 0) {
|
|
61
|
+
$.each(items, function (i, $img) {
|
|
62
|
+
if ($img) {
|
|
63
|
+
var $$img = $($img);
|
|
64
|
+
|
|
65
|
+
// 如果当前img已经定义了src则不执行懒加载
|
|
66
|
+
if (!$$img.attr('src')) {
|
|
67
|
+
|
|
68
|
+
// 添加默认占位图片(解决viewport针对没有高度的元素不执行回调的bug,因此默认追加一张1px的透明图片)
|
|
69
|
+
$$img.attr('src', placeholderSrc);
|
|
70
|
+
// 添加默认占位样式
|
|
71
|
+
$$img.addClass('lazyload-load');
|
|
72
|
+
|
|
73
|
+
// 支持MutationObserver特性
|
|
74
|
+
if (supportsMutationObserver) {
|
|
75
|
+
(0, _inViewPort2.default)($img, { offset: offset }, function (elt) {
|
|
76
|
+
// 获取真实图片地址
|
|
77
|
+
var realSrc = $(elt).attr(src);
|
|
78
|
+
// 获取是否已经执行过懒加载状态
|
|
79
|
+
var isLazyFlag = $(elt).attr('lazy');
|
|
80
|
+
|
|
81
|
+
if (realSrc && !isLazyFlag) {
|
|
82
|
+
$(elt).attr('src', realSrc);
|
|
83
|
+
$(elt)[0].onerror = function (e) {
|
|
84
|
+
// 添加图片加载失败刷新的样式
|
|
85
|
+
$(this).attr('src', 'data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==');
|
|
86
|
+
$(this).addClass('lazyload-loaderror');
|
|
87
|
+
|
|
88
|
+
// 点击重新加载图片
|
|
89
|
+
$(this).on('click', function () {
|
|
90
|
+
if ($(this).hasClass('lazyload-loaderror')) {
|
|
91
|
+
$(this).removeClass('lazyload-loaderror').addClass('lazyload-load').attr('src', realSrc);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
// 已经懒加载则置为1
|
|
96
|
+
$(elt).attr('lazy', '1');
|
|
97
|
+
|
|
98
|
+
console.log('[LazyImage CallBack]:' + realSrc);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
// 不支持MutationObserver特性
|
|
103
|
+
else {
|
|
104
|
+
var realSrc = $$img.attr(src);
|
|
105
|
+
if (realSrc) {
|
|
106
|
+
$$img.attr('src', realSrc);
|
|
107
|
+
console.log('[No LazyImage CallBack]:' + realSrc);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
hooks: {
|
|
118
|
+
onPageDidAppear: function onPageDidAppear(e, pageId, $page, actions, model) {
|
|
119
|
+
actions.lazyLoad.refresh();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}; /**
|
|
124
|
+
* 图片懒加载
|
|
125
|
+
* Created by dfzq on 2017/8/14.
|
|
126
|
+
*/
|
|
127
|
+
exports.LazyLoad = LazyLoad;
|
|
128
|
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
|
|
129
|
+
|
|
130
|
+
/***/ })
|
|
131
|
+
|
|
132
|
+
},[233]);
|
|
133
|
+
});
|
package/loadingman.js
CHANGED
|
@@ -1 +1,81 @@
|
|
|
1
|
-
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory();
|
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
|
5
|
+
define([], factory);
|
|
6
|
+
else if(typeof exports === 'object')
|
|
7
|
+
exports["fastman"] = factory();
|
|
8
|
+
else
|
|
9
|
+
root["fastman"] = factory();
|
|
10
|
+
})(this, function() {
|
|
11
|
+
return webpackJsonpfastman([23],{
|
|
12
|
+
|
|
13
|
+
/***/ 220:
|
|
14
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
15
|
+
|
|
16
|
+
module.exports = __webpack_require__(88);
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
/***/ }),
|
|
20
|
+
|
|
21
|
+
/***/ 88:
|
|
22
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
23
|
+
|
|
24
|
+
"use strict";
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
Object.defineProperty(exports, "__esModule", {
|
|
28
|
+
value: true
|
|
29
|
+
});
|
|
30
|
+
exports.hideLoading = exports.showLoading = undefined;
|
|
31
|
+
|
|
32
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /*
|
|
33
|
+
* @Author: shenzhiwei
|
|
34
|
+
* @Date: 2018-01-01 16:20:10
|
|
35
|
+
* @Company: orientsec.com.cn
|
|
36
|
+
* @Description: loading组件,支持toast风格
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
var _modal = __webpack_require__(10);
|
|
41
|
+
|
|
42
|
+
var showLoading = function showLoading(config) {
|
|
43
|
+
var _text = "",
|
|
44
|
+
_type = "loading";
|
|
45
|
+
if ((typeof config === "undefined" ? "undefined" : _typeof(config)) === 'object') {
|
|
46
|
+
var _config$text = config.text,
|
|
47
|
+
text = _config$text === undefined ? _text : _config$text,
|
|
48
|
+
_config$type = config.type,
|
|
49
|
+
type = _config$type === undefined ? _type : _config$type;
|
|
50
|
+
|
|
51
|
+
_text = text;
|
|
52
|
+
_type = type;
|
|
53
|
+
}
|
|
54
|
+
// 如果loading-modal存在则代表实例已经存在,则不再创建新的
|
|
55
|
+
if ($('.preloader-indicator-modal')[0]) return;
|
|
56
|
+
var loadingStyle = 'preloader-indicator-modal';
|
|
57
|
+
var iconStyle = 'preloader';
|
|
58
|
+
if (_text !== "") {
|
|
59
|
+
loadingStyle += ' toast-loading';
|
|
60
|
+
}
|
|
61
|
+
if (_type === "success") {
|
|
62
|
+
iconStyle = "preloader-success-no-circle";
|
|
63
|
+
}
|
|
64
|
+
var loadingHtml = "<div class=\"preloader-indicator-overlay\"></div><div class=\"" + loadingStyle + "\"><span class=\"" + iconStyle + "\"></span>";
|
|
65
|
+
if (_text !== "") {
|
|
66
|
+
loadingHtml += "<p class=\"text\">" + _text + "</p>";
|
|
67
|
+
}
|
|
68
|
+
loadingHtml += '</div>';
|
|
69
|
+
$(_modal.defaults.modalContainer).append(loadingHtml);
|
|
70
|
+
};
|
|
71
|
+
var hideLoading = function hideLoading() {
|
|
72
|
+
$('.preloader-indicator-overlay, .preloader-indicator-modal').remove();
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
exports.showLoading = showLoading;
|
|
76
|
+
exports.hideLoading = hideLoading;
|
|
77
|
+
|
|
78
|
+
/***/ })
|
|
79
|
+
|
|
80
|
+
},[220]);
|
|
81
|
+
});
|
package/modalman.js
CHANGED
|
@@ -1 +1,264 @@
|
|
|
1
|
-
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory();
|
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
|
5
|
+
define([], factory);
|
|
6
|
+
else if(typeof exports === 'object')
|
|
7
|
+
exports["fastman"] = factory();
|
|
8
|
+
else
|
|
9
|
+
root["fastman"] = factory();
|
|
10
|
+
})(this, function() {
|
|
11
|
+
return webpackJsonpfastman([22],{
|
|
12
|
+
|
|
13
|
+
/***/ 10:
|
|
14
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
15
|
+
|
|
16
|
+
"use strict";
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
Object.defineProperty(exports, "__esModule", {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* Created by linyiqing on 2017/3/16.
|
|
24
|
+
*/
|
|
25
|
+
var _modalTemplateTempDiv = document.createElement('div');
|
|
26
|
+
|
|
27
|
+
$.modalStack = [];
|
|
28
|
+
|
|
29
|
+
$.modalStackClearQueue = function () {
|
|
30
|
+
if ($.modalStack.length) {
|
|
31
|
+
$.modalStack.shift()();
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
var modal = function modal(params) {
|
|
35
|
+
params = params || {};
|
|
36
|
+
var modalHTML = '';
|
|
37
|
+
var buttonsHTML = '';
|
|
38
|
+
if (params.buttons && params.buttons.length > 0) {
|
|
39
|
+
for (var i = 0; i < params.buttons.length; i++) {
|
|
40
|
+
buttonsHTML += '<span class="modal-button' + (params.buttons[i].bold ? ' modal-button-bold' : '') + '">' + params.buttons[i].text + '</span>';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
var extraClass = params.extraClass || '';
|
|
44
|
+
var titleHTML = params.title ? '<div class="modal-title">' + params.title + '</div>' : '';
|
|
45
|
+
var textHTML = params.text ? '<div class="modal-text">' + params.text + '</div>' : '';
|
|
46
|
+
var afterTextHTML = params.afterText ? params.afterText : '';
|
|
47
|
+
var noButtons = !params.buttons || params.buttons.length === 0 ? 'modal-no-buttons' : '';
|
|
48
|
+
var verticalButtons = params.verticalButtons ? 'modal-buttons-vertical' : '';
|
|
49
|
+
var isClose = !!params.isClose; //支持弹框是否可以关闭,目前主要用于alert
|
|
50
|
+
modalHTML = '<div class="modal ' + extraClass + ' ' + noButtons + '">' + (isClose ? '<i class="modal-close">+</i>' : '') + '<div class="modal-inner">' + (titleHTML + textHTML + afterTextHTML) + '</div><div class="modal-buttons ' + verticalButtons + '">' + buttonsHTML + '</div></div>';
|
|
51
|
+
|
|
52
|
+
_modalTemplateTempDiv.innerHTML = modalHTML;
|
|
53
|
+
|
|
54
|
+
var modal = $(_modalTemplateTempDiv).children();
|
|
55
|
+
|
|
56
|
+
$(defaults.modalContainer).append(modal[0]);
|
|
57
|
+
|
|
58
|
+
// Add events on buttons
|
|
59
|
+
modal.find('.modal-button').each(function (index, el) {
|
|
60
|
+
$(el).on('click', function (e) {
|
|
61
|
+
if (params.buttons[index].close !== false) closeModal(modal);
|
|
62
|
+
if (params.buttons[index].onClick) params.buttons[index].onClick(modal, e);
|
|
63
|
+
if (params.onClick) params.onClick(modal, index);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
// close button
|
|
67
|
+
modal.find('.modal-close').on('click', function (e) {
|
|
68
|
+
closeModal(modal);
|
|
69
|
+
});
|
|
70
|
+
openModal(modal);
|
|
71
|
+
return modal[0];
|
|
72
|
+
};
|
|
73
|
+
var openModal = function openModal(modal, cb) {
|
|
74
|
+
modal = $(modal);
|
|
75
|
+
var isModal = modal.hasClass('modal'),
|
|
76
|
+
isNotToast = !modal.hasClass('toast');
|
|
77
|
+
if ($('.modal.modal-in:not(.modal-out)').length && defaults.modalStack && isModal && isNotToast) {
|
|
78
|
+
$.modalStack.push(function () {
|
|
79
|
+
openModal(modal, cb);
|
|
80
|
+
});
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
var isPopup = modal.hasClass('popup-modal');
|
|
84
|
+
var isLoginScreen = modal.hasClass('login-screen');
|
|
85
|
+
var isPickerModal = modal.hasClass('picker-modal');
|
|
86
|
+
var isToast = modal.hasClass('toast');
|
|
87
|
+
var isTipModal = modal.hasClass('tip-modal');
|
|
88
|
+
var isActionsModal = modal.hasClass('actions-modal');
|
|
89
|
+
if (isModal) {
|
|
90
|
+
modal.show();
|
|
91
|
+
modal.css({
|
|
92
|
+
marginTop: -Math.round(modal.outerHeight() / 2) + 'px'
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
if (isToast) {
|
|
96
|
+
modal.css({
|
|
97
|
+
marginLeft: -Math.round(modal.outerWidth() / 2 / 1.185) + 'px' //1.185 是初始化时候的放大效果
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
if (isPopup) {
|
|
101
|
+
modal.show();
|
|
102
|
+
modal.find(".content").scroller("refresh");
|
|
103
|
+
if (modal.find('.' + defaults.viewClass).length > 0) {
|
|
104
|
+
$.sizeNavbars(modal.find('.' + defaults.viewClass)[0]);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (isTipModal || isActionsModal) {
|
|
108
|
+
modal.show();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
var overlay;
|
|
112
|
+
if (!isLoginScreen && !isPickerModal && !isToast && !isTipModal) {
|
|
113
|
+
if ($('.modal-overlay').length === 0 && !isPopup) {
|
|
114
|
+
$(defaults.modalContainer).append('<div class="modal-overlay"></div>');
|
|
115
|
+
}
|
|
116
|
+
if ($('.popup-overlay').length === 0 && isPopup) {
|
|
117
|
+
$(defaults.modalContainer).append('<div class="popup-overlay"></div>');
|
|
118
|
+
}
|
|
119
|
+
overlay = isPopup ? $('.popup-overlay') : $('.modal-overlay');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
//Make sure that styles are applied, trigger relayout;
|
|
123
|
+
var clientLeft = modal[0].clientLeft;
|
|
124
|
+
|
|
125
|
+
// Trugger open event
|
|
126
|
+
modal.trigger('open');
|
|
127
|
+
|
|
128
|
+
// Picker modal body class
|
|
129
|
+
if (isPickerModal) {
|
|
130
|
+
$(defaults.modalContainer).addClass('with-picker-modal');
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Classes for transition in
|
|
134
|
+
if (!isLoginScreen && !isPickerModal && !isToast && !isTipModal) overlay.addClass('modal-overlay-visible');
|
|
135
|
+
modal.removeClass('modal-out').addClass('modal-in').transitionEnd(function (e) {
|
|
136
|
+
if (modal.hasClass('modal-out')) modal.trigger('closed');else modal.trigger('opened');
|
|
137
|
+
});
|
|
138
|
+
// excute callback
|
|
139
|
+
if (typeof cb === 'function') {
|
|
140
|
+
cb.call(this);
|
|
141
|
+
}
|
|
142
|
+
return true;
|
|
143
|
+
};
|
|
144
|
+
var closeModal = function closeModal(modal, cb) {
|
|
145
|
+
modal = $(modal || '.modal-in');
|
|
146
|
+
if (typeof modal !== 'undefined' && modal.length === 0) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
var isModal = modal.hasClass('modal'),
|
|
150
|
+
isPopup = modal.hasClass('popup-modal'),
|
|
151
|
+
isToast = modal.hasClass('toast'),
|
|
152
|
+
isLoginScreen = modal.hasClass('login-screen'),
|
|
153
|
+
isPickerModal = modal.hasClass('picker-modal'),
|
|
154
|
+
isTipModal = modal.hasClass('tip-modal'),
|
|
155
|
+
isActionsModal = modal.hasClass('actions-modal'),
|
|
156
|
+
removeOnClose = modal.hasClass('remove-on-close'),
|
|
157
|
+
|
|
158
|
+
// removeOnClose = true,
|
|
159
|
+
overlay = isPopup ? $('.popup-overlay') : $('.modal-overlay');
|
|
160
|
+
if (isPopup) {
|
|
161
|
+
if (modal.length === $('.popup-modal.modal-in').length) {
|
|
162
|
+
overlay.removeClass('modal-overlay-visible');
|
|
163
|
+
}
|
|
164
|
+
} else if (!(isPickerModal || isToast)) {
|
|
165
|
+
overlay.removeClass('modal-overlay-visible');
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
modal.trigger('close');
|
|
169
|
+
|
|
170
|
+
// Picker modal body class
|
|
171
|
+
if (isPickerModal) {
|
|
172
|
+
$(defaults.modalContainer).removeClass('with-picker-modal');
|
|
173
|
+
$(defaults.modalContainer).addClass('picker-modal-closing');
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
modal.removeClass('modal-in').addClass('modal-out').transitionEnd(function (e) {
|
|
177
|
+
if (modal.hasClass('modal-out')) modal.trigger('closed');else modal.trigger('opened');
|
|
178
|
+
|
|
179
|
+
if (isPickerModal) {
|
|
180
|
+
$(defaults.modalContainer).removeClass('picker-modal-closing');
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// 在modal-dom移除前执行callback函数
|
|
184
|
+
if (typeof cb === 'function') {
|
|
185
|
+
cb.call(this);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (isPopup || isLoginScreen || isPickerModal || isModal || isTipModal || isActionsModal) {
|
|
189
|
+
modal.removeClass('modal-out').hide();
|
|
190
|
+
if (removeOnClose && modal.length > 0) {
|
|
191
|
+
modal.remove();
|
|
192
|
+
}
|
|
193
|
+
} else {
|
|
194
|
+
modal.remove();
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
if (isModal && defaults.modalStack) {
|
|
198
|
+
$.modalStackClearQueue();
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return true;
|
|
202
|
+
};
|
|
203
|
+
function handleClicks(e) {
|
|
204
|
+
/*jshint validthis:true */
|
|
205
|
+
var clicked = $(this);
|
|
206
|
+
var url = clicked.attr('href');
|
|
207
|
+
|
|
208
|
+
//Collect Clicked data- attributes
|
|
209
|
+
var clickedData = clicked.dataset();
|
|
210
|
+
|
|
211
|
+
// Popup
|
|
212
|
+
/*var popup;
|
|
213
|
+
if (clicked.hasClass('open-popup')) {
|
|
214
|
+
if (clickedData.popup) {
|
|
215
|
+
popup = clickedData.popup;
|
|
216
|
+
}
|
|
217
|
+
else popup = '.popup';
|
|
218
|
+
$.popup(popup);
|
|
219
|
+
}
|
|
220
|
+
if (clicked.hasClass('close-popup')) {
|
|
221
|
+
if (clickedData.popup) {
|
|
222
|
+
popup = clickedData.popup;
|
|
223
|
+
}
|
|
224
|
+
else popup = '.popup.modal-in';
|
|
225
|
+
$.closeModal(popup);
|
|
226
|
+
}*/
|
|
227
|
+
|
|
228
|
+
// Close Modal
|
|
229
|
+
if (clicked.hasClass('modal-overlay')) {
|
|
230
|
+
if ($('.modal.modal-in').length > 0 && defaults.modalCloseByOutside) closeModal('.modal.modal-in');
|
|
231
|
+
if ($('.actions-modal.modal-in').length > 0 && defaults.actionsCloseByOutside) closeModal('.actions-modal.modal-in');
|
|
232
|
+
}
|
|
233
|
+
if (clicked.hasClass('popup-overlay')) {
|
|
234
|
+
if ($('.popup-modal.modal-in').length > 0 && defaults.popupCloseByOutside) closeModal('.popup-modal.modal-in');
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
$(document).on('click', ' .modal-overlay, .popup-overlay, .close-popup, .open-popup, .close-picker', handleClicks);
|
|
238
|
+
var defaults = modal.prototype.defaults = {
|
|
239
|
+
modalStack: true,
|
|
240
|
+
modalButtonOk: '确定',
|
|
241
|
+
modalButtonCancel: '取消',
|
|
242
|
+
modalPreloaderTitle: '加载中',
|
|
243
|
+
modalContainer: document.body ? document.body : 'body',
|
|
244
|
+
modalTitle: '',
|
|
245
|
+
actionsCloseByOutside: true
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
exports.defaults = defaults;
|
|
249
|
+
exports.modal = modal;
|
|
250
|
+
exports.openModal = openModal;
|
|
251
|
+
exports.closeModal = closeModal;
|
|
252
|
+
|
|
253
|
+
/***/ }),
|
|
254
|
+
|
|
255
|
+
/***/ 221:
|
|
256
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
257
|
+
|
|
258
|
+
module.exports = __webpack_require__(10);
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
/***/ })
|
|
262
|
+
|
|
263
|
+
},[221]);
|
|
264
|
+
});
|