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

Add tests for geo.gui.widget and geo.gui.domWidget. #795

Merged
merged 4 commits into from
Mar 21, 2018
Merged

Conversation

manthey
Copy link
Contributor

@manthey manthey commented Mar 15, 2018

This removes some unused and untested functions from the widget code, fixes some typos, and renames some internal functions for clarity.

This also adds tests for geo.gui.domWidget and geo.gui.svgWidget.

This removes some unused and untested functions from the widget code,
fixes some typos, and renames some internal functions for clarity and
consistency.
The widget position can be any css-style position, or an x, y coordinate
for the map.  If you change the position using the same attributes as
were used previously, it behaved as expected.  However, if different
attributes were specified, surprising results could occur.

For instance `widget.position({left: 10, top: 10})` followed by
`widget.position({right: 20, top: 10})`, instead of switching the css
from using `left` to `right`, combined them, so that functionally, the
widget was specifying `{left: 10, right: 20, top: 10}`.  Although this
could be avoided by explicitly calling `widget.position({left: null,
right: 20, top: 10})` and could change just one coordinate via call like
`widget.position({top: 11})`, this is surprising behavior.

With this change, setting a widget's position clears the old position
attributes if they are not explicitly set.
@aashish24
Copy link
Member

it is interesting to that appendChild does not appear.

@manthey manthey merged commit 63f796b into master Mar 21, 2018
@manthey manthey deleted the widget-tests branch March 21, 2018 18:02
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.

2 participants