Skip to content

Commit

Permalink
U: fix #12 & #15
Browse files Browse the repository at this point in the history
  • Loading branch information
lizzie committed Oct 29, 2013
1 parent 4444264 commit 707eb9c
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 19 deletions.
15 changes: 10 additions & 5 deletions dist/mask-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ define("arale/overlay/1.1.4/overlay-debug", [ "$-debug", "arale/position/1.0.1/p
// 基准定位元素的定位点,默认为左上角
baseXY: [ 0, 0 ]
},
style: {
position: "absolute",
left: "-9999px",
top: "-9999px"
},
// 父元素
parentNode: document.body
},
Expand All @@ -86,6 +81,16 @@ define("arale/overlay/1.1.4/overlay-debug", [ "$-debug", "arale/position/1.0.1/p
this._setupShim();
// 窗口resize时,重新定位浮层
this._setupResize();
this.after("render", function() {
var _pos = this.element.css("position");
if (_pos === "static" || _pos === "relative") {
this.element.css({
position: "absolute",
left: "-9999px",
top: "-9999px"
});
}
});
// 统一在显示之后重新设定位置
this.after("show", function() {
that._setPosition();
Expand Down
2 changes: 1 addition & 1 deletion dist/mask.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions dist/overlay-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ define("arale/overlay/1.1.4/overlay-debug", [ "$-debug", "arale/position/1.0.1/p
// 基准定位元素的定位点,默认为左上角
baseXY: [ 0, 0 ]
},
style: {
position: "absolute",
left: "-9999px",
top: "-9999px"
},
// 父元素
parentNode: document.body
},
Expand All @@ -46,6 +41,16 @@ define("arale/overlay/1.1.4/overlay-debug", [ "$-debug", "arale/position/1.0.1/p
this._setupShim();
// 窗口resize时,重新定位浮层
this._setupResize();
this.after("render", function() {
var _pos = this.element.css("position");
if (_pos === "static" || _pos === "relative") {
this.element.css({
position: "absolute",
left: "-9999px",
top: "-9999px"
});
}
});
// 统一在显示之后重新设定位置
this.after("show", function() {
that._setPosition();
Expand Down
2 changes: 1 addition & 1 deletion dist/overlay.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 15 additions & 7 deletions src/overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ define(function(require, exports, module) {
baseXY: [0, 0]
},

style: {
position: 'absolute',
left: '-9999px',
top: '-9999px'
},

// 父元素
parentNode: document.body
},
Expand All @@ -60,6 +54,17 @@ define(function(require, exports, module) {
this._setupShim();
// 窗口resize时,重新定位浮层
this._setupResize();

this.after('render', function() {
var _pos = this.element.css('position');
if (_pos === 'static' || _pos === 'relative') {
this.element.css({
position: 'absolute',
left: '-9999px',
top: '-9999px'
});
}
});
// 统一在显示之后重新设定位置
this.after('show', function() {
that._setPosition();
Expand Down Expand Up @@ -87,7 +92,10 @@ define(function(require, exports, module) {

// 在定位时,为避免元素高度不定,先显示出来
if (isHidden) {
this.element.css({ visibility: 'hidden', display: 'block' });
this.element.css({
visibility: 'hidden',
display: 'block'
});
}

Position.pin({
Expand Down

0 comments on commit 707eb9c

Please sign in to comment.