Permalink
Browse files

fix: 日期类型为date类型和loader与dialog混用冲突

  • Loading branch information...
1 parent 670f595 commit 052ffe3d440a1e75a2bbb74cc80c5a9ba4510539 @whizbz11 whizbz11 committed Dec 5, 2016
Showing with 18 additions and 8 deletions.
  1. +8 −0 js/neoui-datetimepicker.js
  2. +10 −8 js/neoui-loader.js
@@ -1129,6 +1129,14 @@ DateTimePicker.fn.show = function(evt){
// if (this.type === 'date' && !env.isMobile){
// this._dateNav.style.display = 'none';
// }
+ // 如果是日期类型,取消显示确认和取消按钮
+ if (this.type === 'date' && !env.isMobile) {
+ this._dateOk = this._panel.querySelector('.u-date-ok');
+ this._dateCancel = this._panel.querySelector('.u-date-cancel');
+ this._dateOk.style.display = 'none';
+ this._dateCancel.style.display = 'none';
+ }
+
this._dateContent = this._panel.querySelector('.u-date-content');
if(this.type == 'datetime'){
/*if(env.isMobile){
View
@@ -3,7 +3,7 @@
* Author : Kvkens(yueming@yonyou.com)
* Date : 2016-08-02 19:02:09
*/
-import {makeDOM, makeModal} from 'tinper-sparrow/js/dom';
+import {makeDOM, makeModal,addClass} from 'tinper-sparrow/js/dom';
/*
*加载loading
@@ -30,6 +30,7 @@ var showLoader = function(options) {
if(hasback) {
var overlayDiv = makeModal(templateDom, parEle);
}
+ addClass(overlayDiv, 'u-loader-back');
if(parEle == document.body) {
templateDom.style.position = 'fixed';
}
@@ -44,14 +45,15 @@ var hideLoader = function(options) {
cssStr = '.u-loader-container';
}
- hasback = options["hasback"];
- if(hasback){
+ // hasback = options["hasback"];
+ // if(hasback){
// 默认删除最高层的
- var overlayDivs = document.querySelectorAll('.u-overlay');
- var l = overlayDivs.length;
- var div = overlayDivs[l-1];
- div.parentNode.removeChild(div);
- }
+ // 清除遮罩层时,不需判断是否有hasback属性,为了兼容之前的用法
+ var overlayDivs = document.querySelectorAll('.u-overlay.u-loader-back');
+ var l = overlayDivs.length;
+ var div = overlayDivs[l-1];
+ div.parentNode.removeChild(div);
+ // }
var divs = document.querySelectorAll(cssStr);
for(var i = 0; i < divs.length; i++) {
divs[i].parentNode.removeChild(divs[i]);

0 comments on commit 052ffe3

Please sign in to comment.