mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 766556 - Cancel text selection on device rotation. r=mfinkle
This commit is contained in:
parent
8317dd0f34
commit
99ba23f673
@ -1428,17 +1428,31 @@ var SelectionHandler = {
|
||||
|
||||
init: function sh_init() {
|
||||
Services.obs.addObserver(this, "Gesture:SingleTap", false);
|
||||
Services.obs.addObserver(this, "Window:Resize", false);
|
||||
},
|
||||
|
||||
uninit: function sh_uninit() {
|
||||
Services.obs.removeObserver(this, "Gesture:SingleTap", false);
|
||||
Services.obs.removeObserver(this, "Window:Resize", false);
|
||||
},
|
||||
|
||||
observe: function sh_observe(aSubject, aTopic, aData) {
|
||||
let data = JSON.parse(aData);
|
||||
switch (aTopic) {
|
||||
case "Gesture:SingleTap": {
|
||||
if (!this._active)
|
||||
return;
|
||||
|
||||
if (this._active)
|
||||
let data = JSON.parse(aData);
|
||||
this.endSelection(data.x, data.y);
|
||||
break;
|
||||
}
|
||||
case "Window:Resize": {
|
||||
// Knowing when the page is done drawing is hard, so let's just cancel
|
||||
// the selection when the window changes. We should fix this later.
|
||||
this.endSelection();
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
notifySelectionChanged: function sh_notifySelectionChanged(aDoc, aSel, aReason) {
|
||||
|
Loading…
Reference in New Issue
Block a user