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

建议修改监听window的resize事件的重定位的处理逻辑 #20

Open
jackyking-cn opened this issue Jul 17, 2014 · 3 comments
Open

Comments

@jackyking-cn
Copy link

Overlay在监听window的resize事件的处理中判断如果窗口的宽高无变化就忽略,这个逻辑在特定需求下存在问题。比如:页面中某个组件的DOM元素宽高发生变化,需要Overlay的位置也跟着变化。如果组件都是独立的,唯一能触发Overlay变化的就只有手动抛出window的resize事件了,但因为窗口的宽高无变化,Overlay不会做任何处理。能否考虑追加一个自定义属性来让Overlay处理手动抛出的resize事件。

@afc163
Copy link
Member

afc163 commented Jul 17, 2014

overlayInstance._setPosition() 重新定位指定的 overlay 即可。

@jackyking-cn
Copy link
Author

无法获取到 overlayInstance 怎么办?而且 _setPosition 是私有方法,直接调用好吗?
还不如提供 Overlay.reposition() 方法。

@afc163
Copy link
Member

afc163 commented Jul 18, 2014

Overlay.query('#id') 可以拿到元素上绑定的实例,担心是私有方法的话,可以用 overlayInstance.set('align', overlayInstance.get('align')) 来重置,效果是一样的。

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

2 participants