kibu-australia / pushy

Clojurescript library for quick and easy HTML5 pushState
Eclipse Public License 1.0
223 stars 28 forks source link

A way to link to elements in the current page #8

Closed sgrove closed 8 years ago

sgrove commented 9 years ago

Related to https://github.com/kibu-australia/pushy/issues/2, would it be possible to have an attribute in target that causes pushy to ignore the event? Semantically, target="_self" makes sense (and is used for e.g. Precursor).

My use case is that I have a long form with a ToC in a sidebar. I want the links in the ToC to link to parts of the page using the id hash (just standard html stuff), but pushy is intercepting the click and disables it (since it otherwise qualifies for a pushy event)

https://github.com/kibu-australia/pushy/blob/master/src/pushy/core.cljs#L118

Could be changed from: (not (= "_blank" (.getAttribute el "target"))) to (not (get #{"_blank" "_self"} (.getAttribute el "target")))

Thanks for Pushy by the way, it's really fantastic!

wavejumper commented 8 years ago

Thanks. Fixed in 0.3.5