Skip to content

Commit

Permalink
Fix Firefox dragging bug again.
Browse files Browse the repository at this point in the history
  • Loading branch information
ngrebenshikov committed Dec 19, 2014
1 parent 6fc8ee5 commit 4ea097a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion openfl/Lib.hx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Lib {

private static inline var DEFAULT_HEIGHT = 500;
private static inline var DEFAULT_WIDTH = 500;
private static var HTML_DIV_EVENT_TYPES = [ 'resize', /*'mouseup',*/ 'mouseover', 'mouseout', /*'mousemove', 'mousedown',*/ 'mousewheel'/*, 'dblclick', 'click'*/ ];
private static var HTML_DIV_EVENT_TYPES = [ 'dragstart', 'resize', /*'mouseup',*/ 'mouseover', 'mouseout', /*'mousemove', 'mousedown',*/ 'mousewheel'/*, 'dblclick', 'click'*/ ];
private static var HTML_TOUCH_EVENT_TYPES = [ 'touchstart', 'touchmove', 'touchend' ];
private static var HTML_TOUCH_ALT_EVENT_TYPES = [ 'mousedown', 'mousemove', 'mouseup' ];
private static var HTML_WINDOW_EVENT_TYPES = [ 'keyup', 'keypress', 'keydown', 'resize', 'blur', 'focus', 'paste' ];
Expand Down
8 changes: 4 additions & 4 deletions openfl/display/Stage.hx
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ class Stage extends DisplayObjectContainer {
__onMouse (cast evt, MouseEvent.MOUSE_MOVE);

case "mousedown":

__onMouse (cast evt, MouseEvent.MOUSE_DOWN);

case "mouseup":
Expand Down Expand Up @@ -423,14 +422,15 @@ class Stage extends DisplayObjectContainer {

public function __queueStageEvent (evt:js.html.Event):Void {
var target: Element = cast evt.target;

if (evt.type == 'keydown') {
if (evt.type == "dragstart") {
evt.preventDefault();
} else if (evt.type == "keydown") {
var e: KeyboardEvent = cast evt;
if (e.keyCode == Keyboard.V && (e.ctrlKey || e.commandKey || e.controlKey || cast(e).metaKey)) {
var document: Document = untyped window.document;
var curFocus = document.activeElement;
var input = document.getElementById('openfl-snapsvg-input');
input.innerText = '';
input.innerText = "";
e.stopImmediatePropagation();

input.addEventListener('focusin', stopPropagationOfEvent);
Expand Down

0 comments on commit 4ea097a

Please sign in to comment.