avoid duplicate code
This commit is contained in:
@@ -339,6 +339,13 @@ class HTML5Window
|
|||||||
|
|
||||||
public function focus():Void {}
|
public function focus():Void {}
|
||||||
|
|
||||||
|
public function focusTextInputWithDelay():Void {
|
||||||
|
Timer.delay(function()
|
||||||
|
{
|
||||||
|
if (textInputEnabled) textInput.focus();
|
||||||
|
}, 20);
|
||||||
|
}
|
||||||
|
|
||||||
public function getCursor():MouseCursor
|
public function getCursor():MouseCursor
|
||||||
{
|
{
|
||||||
return cursor;
|
return cursor;
|
||||||
@@ -457,10 +464,7 @@ class HTML5Window
|
|||||||
{
|
{
|
||||||
if (event.relatedTarget == null || isDescendent(cast event.relatedTarget))
|
if (event.relatedTarget == null || isDescendent(cast event.relatedTarget))
|
||||||
{
|
{
|
||||||
Timer.delay(function()
|
focusTextInputWithDelay();
|
||||||
{
|
|
||||||
if (textInputEnabled) textInput.focus();
|
|
||||||
}, 20);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -925,10 +929,7 @@ class HTML5Window
|
|||||||
{
|
{
|
||||||
Browser.document.execCommand("copy");
|
Browser.document.execCommand("copy");
|
||||||
}
|
}
|
||||||
Timer.delay(function()
|
focusTextInputWithDelay();
|
||||||
{
|
|
||||||
if (textInputEnabled) textInput.focus();
|
|
||||||
}, 20);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setCursor(value:MouseCursor):MouseCursor
|
public function setCursor(value:MouseCursor):MouseCursor
|
||||||
|
|||||||
Reference in New Issue
Block a user