Skip to content

Commit 0378b29

Browse files
committed
Fix:popover弹出时,点击遮罩,将body的style置空
1 parent f3a0082 commit 0378b29

File tree

5 files changed

+2
-35
lines changed

5 files changed

+2
-35
lines changed

dist/js/mui.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6062,13 +6062,6 @@ Function.prototype.bind = Function.prototype.bind || function(to) {
60626062
isContinue: true
60636063
});
60646064

6065-
var fixedPopoverScroll = function(isPopoverScroll) {
6066-
// if (isPopoverScroll) {
6067-
// document.body.setAttribute('style', 'overflow:hidden;');
6068-
// } else {
6069-
// document.body.setAttribute('style', '');
6070-
// }
6071-
};
60726065
var onPopoverShown = function(e) {
60736066
this.removeEventListener('webkitTransitionEnd', onPopoverShown);
60746067
this.addEventListener($.EVENT_MOVE, $.preventDefault);
@@ -6078,7 +6071,6 @@ Function.prototype.bind = Function.prototype.bind || function(to) {
60786071
setStyle(this, 'none');
60796072
this.removeEventListener('webkitTransitionEnd', onPopoverHidden);
60806073
this.removeEventListener($.EVENT_MOVE, $.preventDefault);
6081-
fixedPopoverScroll(false);
60826074
$.trigger(this, 'hidden', this);
60836075
};
60846076

@@ -6092,7 +6084,6 @@ Function.prototype.bind = Function.prototype.bind || function(to) {
60926084
popover.addEventListener('webkitTransitionEnd', onPopoverHidden);
60936085
popover.classList.remove(CLASS_ACTIVE);
60946086
removeBackdrop(popover);
6095-
document.body.setAttribute('style', ''); //webkitTransitionEnd有时候不触发?
60966087
}
60976088
});
60986089

@@ -6142,7 +6133,6 @@ Function.prototype.bind = Function.prototype.bind || function(to) {
61426133
_popover.addEventListener('webkitTransitionEnd', onPopoverHidden);
61436134
_popover.classList.remove(CLASS_ACTIVE);
61446135
// _popover.removeEventListener('webkitTransitionEnd', onPopoverHidden);
6145-
// fixedPopoverScroll(false);
61466136
//同一个弹出则直接返回,解决同一个popover的toggle
61476137
if (popover === _popover) {
61486138
removeBackdrop(_popover);
@@ -6173,7 +6163,6 @@ Function.prototype.bind = Function.prototype.bind || function(to) {
61736163
popover.classList.add(CLASS_ACTIVE);
61746164
backdrop.setAttribute('style', '');
61756165
document.body.appendChild(backdrop);
6176-
fixedPopoverScroll(true);
61776166
calPosition(popover, anchor, isActionSheet); //position
61786167
backdrop.classList.add(CLASS_ACTIVE);
61796168
popover.addEventListener('webkitTransitionEnd', onPopoverShown);

dist/js/mui.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/hello-mui/js/mui.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6062,13 +6062,6 @@ Function.prototype.bind = Function.prototype.bind || function(to) {
60626062
isContinue: true
60636063
});
60646064

6065-
var fixedPopoverScroll = function(isPopoverScroll) {
6066-
// if (isPopoverScroll) {
6067-
// document.body.setAttribute('style', 'overflow:hidden;');
6068-
// } else {
6069-
// document.body.setAttribute('style', '');
6070-
// }
6071-
};
60726065
var onPopoverShown = function(e) {
60736066
this.removeEventListener('webkitTransitionEnd', onPopoverShown);
60746067
this.addEventListener($.EVENT_MOVE, $.preventDefault);
@@ -6078,7 +6071,6 @@ Function.prototype.bind = Function.prototype.bind || function(to) {
60786071
setStyle(this, 'none');
60796072
this.removeEventListener('webkitTransitionEnd', onPopoverHidden);
60806073
this.removeEventListener($.EVENT_MOVE, $.preventDefault);
6081-
fixedPopoverScroll(false);
60826074
$.trigger(this, 'hidden', this);
60836075
};
60846076

@@ -6092,7 +6084,6 @@ Function.prototype.bind = Function.prototype.bind || function(to) {
60926084
popover.addEventListener('webkitTransitionEnd', onPopoverHidden);
60936085
popover.classList.remove(CLASS_ACTIVE);
60946086
removeBackdrop(popover);
6095-
document.body.setAttribute('style', ''); //webkitTransitionEnd有时候不触发?
60966087
}
60976088
});
60986089

@@ -6142,7 +6133,6 @@ Function.prototype.bind = Function.prototype.bind || function(to) {
61426133
_popover.addEventListener('webkitTransitionEnd', onPopoverHidden);
61436134
_popover.classList.remove(CLASS_ACTIVE);
61446135
// _popover.removeEventListener('webkitTransitionEnd', onPopoverHidden);
6145-
// fixedPopoverScroll(false);
61466136
//同一个弹出则直接返回,解决同一个popover的toggle
61476137
if (popover === _popover) {
61486138
removeBackdrop(_popover);
@@ -6173,7 +6163,6 @@ Function.prototype.bind = Function.prototype.bind || function(to) {
61736163
popover.classList.add(CLASS_ACTIVE);
61746164
backdrop.setAttribute('style', '');
61756165
document.body.appendChild(backdrop);
6176-
fixedPopoverScroll(true);
61776166
calPosition(popover, anchor, isActionSheet); //position
61786167
backdrop.classList.add(CLASS_ACTIVE);
61796168
popover.addEventListener('webkitTransitionEnd', onPopoverShown);

examples/hello-mui/js/mui.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/popovers.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,6 @@
4242
isContinue: true
4343
});
4444

45-
var fixedPopoverScroll = function(isPopoverScroll) {
46-
// if (isPopoverScroll) {
47-
// document.body.setAttribute('style', 'overflow:hidden;');
48-
// } else {
49-
// document.body.setAttribute('style', '');
50-
// }
51-
};
5245
var onPopoverShown = function(e) {
5346
this.removeEventListener('webkitTransitionEnd', onPopoverShown);
5447
this.addEventListener($.EVENT_MOVE, $.preventDefault);
@@ -58,7 +51,6 @@
5851
setStyle(this, 'none');
5952
this.removeEventListener('webkitTransitionEnd', onPopoverHidden);
6053
this.removeEventListener($.EVENT_MOVE, $.preventDefault);
61-
fixedPopoverScroll(false);
6254
$.trigger(this, 'hidden', this);
6355
};
6456

@@ -72,7 +64,6 @@
7264
popover.addEventListener('webkitTransitionEnd', onPopoverHidden);
7365
popover.classList.remove(CLASS_ACTIVE);
7466
removeBackdrop(popover);
75-
document.body.setAttribute('style', ''); //webkitTransitionEnd有时候不触发?
7667
}
7768
});
7869

@@ -122,7 +113,6 @@
122113
_popover.addEventListener('webkitTransitionEnd', onPopoverHidden);
123114
_popover.classList.remove(CLASS_ACTIVE);
124115
// _popover.removeEventListener('webkitTransitionEnd', onPopoverHidden);
125-
// fixedPopoverScroll(false);
126116
//同一个弹出则直接返回,解决同一个popover的toggle
127117
if (popover === _popover) {
128118
removeBackdrop(_popover);
@@ -153,7 +143,6 @@
153143
popover.classList.add(CLASS_ACTIVE);
154144
backdrop.setAttribute('style', '');
155145
document.body.appendChild(backdrop);
156-
fixedPopoverScroll(true);
157146
calPosition(popover, anchor, isActionSheet); //position
158147
backdrop.classList.add(CLASS_ACTIVE);
159148
popover.addEventListener('webkitTransitionEnd', onPopoverShown);

0 commit comments

Comments
 (0)