aframe-href-component icon indicating copy to clipboard operation
aframe-href-component copied to clipboard

Hash logic perpaps too prescriptive

Open cvan opened this issue 8 years ago • 2 comments

I may want to change the hash of the page for reasons unrelated to A-Frame entities (e.g., a URL for #siteInfo).

IMO, the logic should be simplified to check if URL starts with a #, and then set window.location.hash. Otherwise, window.location.href.

Also, if you're going to support jumping to A-Frame entities based on their ids, perhaps add separate logic (IMO a separate component) that actually uses a hashchange listener.

cvan avatar May 02 '16 21:05 cvan

got your point @cvan . I think for general web developer its still a nature behavior to expect how anchor works with href attribute though.

I'd like to have the separate logic in the target component, that

  • implement HTML target="window" and target="_blank".

By extend it, user can add

  • target="hash" to only change the hash of the page
  • target="camera (not determined)" to specify the camera angle and the distance,
  • target="(not determined)" to listen to hashchange and specify the transition animation.

Does it make sense to you?

gasolin avatar May 05 '16 02:05 gasolin

basic target attribute support is commited in e485254

gasolin avatar May 11 '16 13:05 gasolin