Fix : drawing with the right mouse button (FF, IE)

Mousemove events do not have the correct button information
Need to keep the state of which button is clicked at which moment

This was actually the initial implementation ...
But I removed it because I couldn't remember why we did this in the
beginning.

Added lots of 'warnings' in comments, but won't be safe until we get good
integration tests.

References :
- FF : https://bugzilla.mozilla.org/show_bug.cgi?id=297919
"What if multiple buttons are pressed during mouse move?  And how does the
integer field (button) indicate that no button is pressed?  I think this
should be wontfix -- if people need button information during mouse move events
we need a new way of getting it (buttonSet), not the same way it works for click,
etc."
- IE : couldn't find any reference ...
This commit is contained in:
jdescottes
2014-03-30 20:39:00 +02:00
parent b734db28dc
commit 6d62d11872
2 changed files with 29 additions and 6 deletions

View File

@ -98,7 +98,14 @@
ns.PalettesListController.prototype.onColorUpdated = function (type, event, color) {
console.log('[PalettesListController] >>> ', arguments);
var colorContainer = this.colorListContainer_.querySelector('.palettes-list-color[data-color="'+color+'"]');
// Color is not in the currently selected palette
if (!colorContainer) {
return;
}
if (type === 'primary') {
this.removeClass_('primary', '.palettes-list-color');
colorContainer.classList.add('primary');