mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 919803 fix panel sizing by not removing panel iframe unecessarily, r=markh
This commit is contained in:
parent
4a1b198331
commit
504fa94de0
@ -874,18 +874,27 @@ SocialToolbar = {
|
||||
let toggleNotificationsCommand = document.getElementById("Social:ToggleNotifications");
|
||||
toggleNotificationsCommand.setAttribute("hidden", !socialEnabled);
|
||||
|
||||
let parent = document.getElementById("social-notification-panel");
|
||||
while (parent.hasChildNodes()) {
|
||||
let frame = parent.firstChild;
|
||||
SharedFrame.forgetGroup(frame.id);
|
||||
parent.removeChild(frame);
|
||||
}
|
||||
|
||||
// we need to remove buttons and frames if !socialEnabled or the provider
|
||||
// has changed (frame origin does not match current provider). We only
|
||||
// remove frames that are "attached" to buttons in this toolbar button since
|
||||
// other buttons may also be using grouped frames.
|
||||
let tbi = document.getElementById("social-provider-button");
|
||||
if (tbi) {
|
||||
// buttons after social-provider-button are ambient icons
|
||||
while (tbi.nextSibling) {
|
||||
tbi.parentNode.removeChild(tbi.nextSibling);
|
||||
let next = tbi.nextSibling;
|
||||
let currentOrigin = Social.provider ? Social.provider.origin : null;
|
||||
|
||||
while (next) {
|
||||
let button = next;
|
||||
next = next.nextSibling;
|
||||
// get the frame for this button
|
||||
let frameId = button.getAttribute("notificationFrameId");
|
||||
let frame = document.getElementById(frameId);
|
||||
if (!socialEnabled || frame.getAttribute("origin") != currentOrigin) {
|
||||
SharedFrame.forgetGroup(frame.id);
|
||||
frame.parentNode.removeChild(frame);
|
||||
button.parentNode.removeChild(button);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user