Commit 8a1ffaf6 authored by graouts@apple.com's avatar graouts@apple.com

Web Inspector: control+clicking on a numeric token should not show the context menu

https://bugs.webkit.org/show_bug.cgi?id=119048

Reviewed by Timothy Hatcher.

Track "contextmenu" events when we're hovering a token containing a numeric value
and call preventDefault() in the event handler to ensure that the context menu does
not appear.

* UserInterface/CodeMirrorDragToAlterNumberController.js:
(WebInspector.CodeMirrorDragToAlterNumberController.prototype.handleEvent):
(WebInspector.CodeMirrorDragToAlterNumberController.prototype._setTracksMouseClickAndDrag):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153091 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4831816e
2013-07-24 Antoine Quint <graouts@apple.com>
Web Inspector: control+clicking on a numeric token should not show the context menu
https://bugs.webkit.org/show_bug.cgi?id=119048
Reviewed by Timothy Hatcher.
Track "contextmenu" events when we're hovering a token containing a numeric value
and call preventDefault() in the event handler to ensure that the context menu does
not appear.
* UserInterface/CodeMirrorDragToAlterNumberController.js:
(WebInspector.CodeMirrorDragToAlterNumberController.prototype.handleEvent):
(WebInspector.CodeMirrorDragToAlterNumberController.prototype._setTracksMouseClickAndDrag):
2013-07-24 Antoine Quint <graouts@apple.com>
Web Inspector: support click-and-drag editing of CSS numeric values
......
......@@ -80,6 +80,9 @@ WebInspector.CodeMirrorDragToAlterNumberController.prototype = {
case "mouseup":
this._mouseWasReleased(event);
break;
case "contextmenu":
event.preventDefault();
break;
}
},
......@@ -125,9 +128,11 @@ WebInspector.CodeMirrorDragToAlterNumberController.prototype = {
if (tracksMouseClickAndDrag) {
this._element.classList.add(WebInspector.CodeMirrorDragToAlterNumberController.StyleClassName);
window.addEventListener("mousedown", this, true);
window.addEventListener("contextmenu", this, true);
} else {
this._element.classList.remove(WebInspector.CodeMirrorDragToAlterNumberController.StyleClassName);
window.removeEventListener("mousedown", this, true);
window.removeEventListener("contextmenu", this, true);
this._setDragging(false);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment