Bug 935561 - [Messaging] Attach icon is kept like pressed when tapping on it and cancel selecting a content to attach. r=fabrice

This commit is contained in:
Vivien Nicolas 2013-11-22 13:45:05 +01:00
parent e035127d5b
commit 037bbc9f2f
2 changed files with 10 additions and 4 deletions

View File

@ -77,10 +77,12 @@ ActivityProxy.prototype = {
debug("FireSuccess");
Services.DOMRequest.fireSuccess(this.activity,
ObjectWrapper.wrap(msg.result, this.window));
Services.obs.notifyObservers(null, "Activity:Success", null);
break;
case "Activity:FireError":
debug("FireError");
Services.DOMRequest.fireError(this.activity, msg.error);
Services.obs.notifyObservers(null, "Activity:Error", null);
break;
}
// We can only get one FireSuccess / FireError message, so cleanup as soon as possible.

View File

@ -63,8 +63,10 @@ const ContentPanning = {
addMessageListener("Viewport:Change", this._recvViewportChange.bind(this));
addMessageListener("Gesture:DoubleTap", this._recvDoubleTap.bind(this));
addEventListener("visibilitychange", this._recvVisibilityChange.bind(this));
addEventListener("visibilitychange", this._handleVisibilityChange.bind(this));
Services.obs.addObserver(this, "BEC:ShownModalPrompt", false);
Services.obs.addObserver(this, "Activity:Success", false);
Services.obs.addObserver(this, "Activity:Error", false);
},
handleEvent: function cp_handleEvent(evt) {
@ -461,8 +463,10 @@ const ContentPanning = {
_resetHover: function cp_resetHover() {
const kStateHover = 0x00000004;
let element = content.document.createElement('foo');
this._domUtils.setContentState(element, kStateHover);
try {
let element = content.document.createElement('foo');
this._domUtils.setContentState(element, kStateHover);
} catch(e) {}
},
_setActive: function cp_setActive(elt) {
@ -546,7 +550,7 @@ const ContentPanning = {
}
},
_recvVisibilityChange: function(evt) {
_handleVisibilityChange: function(evt) {
if (!evt.target.hidden)
return;