jedediah / wetbanana

Click+drag extension with physics for Google Chrome
https://chrome.google.com/extensions/detail/ljecomdaijmibecakcpjadigpfkollbh
9 stars 9 forks source link

Left-click forbidden elements apply to non-left-clicks #12

Closed arpsmack closed 14 years ago

arpsmack commented 14 years ago

This behavior might actually be intended, but to me its a bug. If you set your scroll button to right-click, you still won't be able to scroll over the left-click forbidden elements such as links and embeds.

I made the following change in the onMouseDown handler to fix this issue:

if (ev.target && ev.button == 1 && OVERRIDE_TAGS.some(function(tag) { return tag == ev.target.tagName })) {
  debug("forbidden left-click target element, ignoring   ev.target="+ev.target.tagName)
  return
}

Edit: I tried to emphasize the part that I added, but I couldn't find a way to do that inside a code-block using Markdown syntax.

I added an additional check to make sure that the event button was set to 1 (left-click): ev.button == 1

jedediah commented 14 years ago

I think I'll keep this as is. The overridden elements tend to be small and can require the use of any button. Thanks for the report though.