5
I have a form where there’s a table. At the bottom of this, there are buttons to manipulate the table rows, and only the selected ones will be affected.
Steps to play problem
jsfiddle to check the problem
fiddle result for testing in IE 8
- click on any box so that it turns orange
- click on one of the command buttons
click again on the box to deselect the line
Won’t work!
click again to deselect the line
Now it works!
This fiddle is already with javascript code very well isolated, not even scroll in the fiddle (in the part of the script, which is where I think the problem is)... but still could not solve the problem.
Question
How to make the box deselect on first click?
Please, if you know the solution, explain to me... do not just put code... I would very much like to know why this is not working.
Browsers I tested that present the problem: Chrome 34, Firefox 28, IE 8
To tell you the truth, I care a lot about solving for Chrome, a little less for FF, and not a little bit for IE 8... I only mentioned IE 8 to show that the problem is consistent between browsers.
Notes:
I found that by removing the lines below, it works the way I want it... almost... Are two lines equal to this:
.bind("blur mouseout", restore)
However, this way I lose the mouse-out, which serves to clear the icon that is placed inside the orange box indicating which lines are affected, because not always a selected line can be affected by a command.
Do you have any code for when the button is clicked? i.e.: want to use Event Handler
click
to run code when the button is clicked? Or only uses themousehover
andmouseout
?– Sergio