mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-15 04:39:31 +00:00
Bug 1028329 - Cancel delayed automove if there is an explicit interaction by the user. r=yzen
This commit is contained in:
parent
f62927140f
commit
8b13d8981f
@ -75,6 +75,9 @@ this.ContentControl.prototype = {
|
||||
JSON.stringify(aMessage.json)];
|
||||
});
|
||||
|
||||
// If we get an explicit message, we should immediately cancel any autoMove
|
||||
this.cancelAutoMove();
|
||||
|
||||
try {
|
||||
let func = this['handle' + aMessage.name.slice(9)]; // 'AccessFu:'.length
|
||||
if (func) {
|
||||
@ -381,8 +384,7 @@ this.ContentControl.prototype = {
|
||||
* - moveMethod: pivot move method to use, default is 'moveNext',
|
||||
*/
|
||||
autoMove: function cc_autoMove(aAnchor, aOptions = {}) {
|
||||
let win = this.window;
|
||||
win.clearTimeout(this._autoMove);
|
||||
this.cancelAutoMove();
|
||||
|
||||
let moveFunc = () => {
|
||||
let vc = this.vc;
|
||||
@ -432,12 +434,17 @@ this.ContentControl.prototype = {
|
||||
};
|
||||
|
||||
if (aOptions.delay) {
|
||||
this._autoMove = win.setTimeout(moveFunc, aOptions.delay);
|
||||
this._autoMove = this.window.setTimeout(moveFunc, aOptions.delay);
|
||||
} else {
|
||||
moveFunc();
|
||||
}
|
||||
},
|
||||
|
||||
cancelAutoMove: function cc_cancelAutoMove() {
|
||||
this.window.clearTimeout(this._autoMove);
|
||||
this._autoMove = 0;
|
||||
},
|
||||
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsISupportsWeakReference,
|
||||
Ci.nsIMessageListener
|
||||
])
|
||||
|
Loading…
x
Reference in New Issue
Block a user