Skip to content
This repository has been archived by the owner on May 25, 2019. It is now read-only.

fix: Removed map- prefix from event names #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ProLoser
Copy link
Member

I didn't see a reason to keep the prefix as the original DOM elements
are not used for anything else

This is a Pull Request because it's a destructive change. If anyone disagrees please make your voice known.

I didn't see a reason to keep the prefix as the original DOM elements
are not used for anything else
@glebm
Copy link
Contributor

glebm commented May 16, 2013

I use original DOM events, because I need to to do a hack outside of $apply. Will this change break them?

@ProLoser
Copy link
Member Author

I'm a little confused, can you paste a snippet?

What this does is before, things like clickclose events (from Google Maps API) would actually be routed to ui-event as map-clickclose to avoid accidentally triggering normal events on the relevant DOM element.

I'm essentially dropping the prefix because I don't think the relevant DOM elements are used for anything other than giving you a handle to the map objects, and it only serves to make usage more complicated/confusing.

@glebm
Copy link
Contributor

glebm commented May 19, 2013

Will I still be able to bind directly like in the snippet below?

google.maps.event.addListener(scope.googleMap, 'bounds_changed', onBoundsChanged) # onBoundsChanged called outside $apply
# and trigger
google.maps.event.trigger(scope.googleMap, 'resize')

@ProLoser
Copy link
Member Author

Yes that will be completely unaffected. This only effects people who bind
using ui-event
On May 19, 2013 7:20 AM, "Gleb Mazovetskiy" [email protected]
wrote:

Will I still be able to bind directly like in the snippet below?

google.maps.event.addListener(scope.googleMap, 'bounds_changed', onBoundsChanged)

and

google.maps.event.trigger(s.googleMap, 'resize')


Reply to this email directly or view it on GitHubhttps://github.com//pull/9#issuecomment-18118379
.

@glebm
Copy link
Contributor

glebm commented May 20, 2013

OK, great! Thanks, sorry for not getting it :)

google.maps.event.addListener(googleObject, eventName, function (event) {
element.triggerHandler('map-' + eventName, event);
element.triggerHandler(eventName, event);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

event will be undefined if methods like setCenter are called on an invisible map. if (!event) return?

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

Successfully merging this pull request may close these issues.

2 participants