Skip to content

Update jquery.ui.treemap.js#8

Open
sekharreddykasu wants to merge 2 commits into
evancarey:masterfrom
sekharreddykasu:patch-1
Open

Update jquery.ui.treemap.js#8
sekharreddykasu wants to merge 2 commits into
evancarey:masterfrom
sekharreddykasu:patch-1

Conversation

@sekharreddykasu
Copy link
Copy Markdown

Double click event added

@evancarey
Copy link
Copy Markdown
Owner

Hi sekharreddykaau,

Thanks for your pull request. I checked out your branch and did some testing. Unfortunately, I found that only the click event is triggered. Were you able to get the double click event? I tested using Chrome and Firefox. After a little digging I found the comment below on the page http://api.jquery.com/dblclick/

'It is inadvisable to bind handlers to both the click and dblclick events for the same element. The sequence of events triggered varies from browser to browser, with some receiving two click events before the dblclick and others only one. Double-click sensitivity (maximum time between clicks that is detected as a double click) can vary by operating system and browser, and is often user-configurable.'

Along with that quote I also found some various work arounds using timeouts and such.
http://stackoverflow.com/questions/6330431/jquery-bind-double-click-and-single-click-separately

It looks like adding support for dblclick is trickier than you'd expect.

At this point I'm thinking since determining if there's been a double click or not can be handled outside the jsTreemap plugin and in the user's implementation of their treemapclick handler instead.

Also, the update to the line
var i = Math.floor(val_(map.length/4-1))4;
to
var i = Math.floor(val
(map.length/4))_4;
will cause a maximal val to get the undefined color black.
screen shot 2015-02-17 at 10 21 21 pm

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