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

增加浏览器左右边缘的判断 #11

Closed
wants to merge 1 commit into from
Closed

增加浏览器左右边缘的判断 #11

wants to merge 1 commit into from

Conversation

dafeizizhu
Copy link

想了解一下是不是故意不做左右边缘的判断:)

查看Tip的文档,当tip的内容比较长,而且tip比较接近于浏览器的右边缘,而tip又没有显式指定宽度,tip的内容会自动折行。如果直接计算的话计算出来的tip的长度是折行后的长度,导致改变tip的位置后,tip相对于trigger的位置不正确。

所以在arale/position又提了一个pull request aralejs/position#8,来支持获取tip原来正确的宽度。

@afc163
Copy link
Member

afc163 commented Sep 26, 2013

赞。

首先,之所以没有左右的判断是因为没有人提这个需求。

现在的网页,垂直方向是主要的瓶颈,水平方向如果由于内容太长溢出了,恐怕另一个方向也不够。而且如果 trigger 出现在页面边缘了,tip 的方向应该也不会设为边缘的方向。

思路和代码都没啥问题,但我还是倾向不合并。

@dafeizizhu
Copy link
Author

主要是考虑trigger在视口的左侧或者右侧的情况,如果不判断的话2点和10点的tip就可能显示不全了:)

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 04a0d1c on dafeizizhu:enhance-make-sure-in-viewport into 451e27d on aralejs:master.

@dafeizizhu
Copy link
Author

犯傻了,这个其实不合入也行,在我自己的子类里面增加对应的逻辑就可以了:)

@lizzie
Copy link
Member

lizzie commented Feb 7, 2014

不合的话, 就关了

@lizzie lizzie closed this Feb 7, 2014
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

Successfully merging this pull request may close these issues.

4 participants