Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复 https://github.com/aralejs/tip/issues/12 的后遗症 #15

Closed
lianqin7 opened this issue Oct 29, 2013 · 4 comments
Closed

修复 https://github.com/aralejs/tip/issues/12 的后遗症 #15

lianqin7 opened this issue Oct 29, 2013 · 4 comments

Comments

@lianqin7
Copy link
Member

https://github.com/aralejs/overlay/blob/master/src/overlay.js#L34

这里强行的设置了 absolute,导致原来在 css 上的 fixed 失效了!

建议设置 absolute 前做个保护性判断,如果已经设置了 position 属性就不去设置了

@lianqin7
Copy link
Member Author

@lizzie

lizzie added a commit that referenced this issue Oct 29, 2013
@lizzie
Copy link
Member

lizzie commented Oct 29, 2013

重新改了下, 原本的执行过程:

  1. _onRenderStyle
  2. element 插入 DOM
  3. render 结束
  4. show
  5. setPosition

放在 attr 中的 style 会在 1) 就执行掉, 如果外部给 element 设置了 position, 这边就会强制设 position:absolute, 导致错误.
现在放在 render 结束之后, show 之前, 设置 https://github.com/aralejs/overlay/blob/master/src/overlay.js#L58 , 判断 position 是否有另外设置.

@lizzie lizzie closed this as completed Oct 29, 2013
lizzie added a commit that referenced this issue Oct 29, 2013
@lianqin7
Copy link
Member Author

赞这速度!等会下来研究下!

@nuintun
Copy link

nuintun commented Oct 29, 2013

@lianqin7 @lizzie 的速度一直都是刚刚的:stuck_out_tongue:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants