bug 821170 - expose a reshow method in PopupNotifications and use it r=jaws

This commit is contained in:
David Keeler 2013-01-07 16:30:35 -08:00
parent 0afdefa66f
commit ff24715913
3 changed files with 11 additions and 6 deletions

View File

@ -280,8 +280,7 @@ var gPluginHandler = {
let notification = PopupNotifications.getNotification("click-to-play-plugins", aBrowser);
if (notification && plugins.length > 0 && !haveVisibleCTPPlugin && !this._notificationDisplayedOnce) {
notification.dismissed = false;
PopupNotifications._update(notification.anchorElement);
notification.reshow();
this._notificationDisplayedOnce = true;
}

View File

@ -827,9 +827,8 @@ function test21a() {
}
// we have to actually show the panel to get the bindings to instantiate
notification.options.dismissed = false;
notification.options.eventCallback = test21b;
PopupNotifications._showPanel([notification], notification.anchorElement);
notification.reshow();
}
function test21b() {
@ -887,9 +886,8 @@ function test21c() {
}
// we have to actually show the panel to get the bindings to instantiate
notification.options.dismissed = false;
notification.options.eventCallback = test21d;
PopupNotifications._showPanel([notification], notification.anchorElement);
notification.reshow();
}
function test21d() {

View File

@ -68,6 +68,10 @@ Notification.prototype = {
iconBox;
return anchorElement;
},
reshow: function() {
this.owner.reshow(this.anchorElement);
}
};
@ -625,6 +629,10 @@ PopupNotifications.prototype = {
while (anchor && anchor.parentNode != this.iconBox)
anchor = anchor.parentNode;
this.reshow(anchor);
},
reshow: function PopupNotifications_reshow(anchor) {
// Mark notifications anchored to this anchor as un-dismissed
this._currentNotifications.forEach(function (n) {
if (n.anchorElement == anchor)