[PALEMOON] Prevent overlapping modal prompts and preserve prompt order.

pull/7/head
wolfbeast 3 years ago committed by Roy Tam
parent 852ce8292d
commit 100fe48e7b
  1. 10
      application/palemoon/base/content/tabbrowser.xml

@ -402,11 +402,18 @@
let promptBox = {
appendPrompt : function(args, onCloseCallback) {
let newPrompt = document.createElementNS(XUL_NS, "tabmodalprompt");
stack.appendChild(newPrompt);
// stack.appendChild(newPrompt);
stack.insertBefore(newPrompt, browser.nextSibling);
browser.setAttribute("tabmodalPromptShowing", true);
newPrompt.clientTop; // style flush to assure binding is attached
let prompts = this.listPrompts();
if (prompts.length > 1) {
// Let's hide ourself behind the current prompt.
newPrompt.hidden = true;
}
let tab = self._getTabForContentWindow(browser.contentWindow);
newPrompt.init(args, tab, onCloseCallback);
return newPrompt;
@ -418,6 +425,7 @@
let prompts = this.listPrompts();
if (prompts.length) {
let prompt = prompts[prompts.length - 1];
prompt.hidden = false;
prompt.Dialog.setDefaultFocus();
} else {
browser.removeAttribute("tabmodalPromptShowing");

Loading…
Cancel
Save