mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 00:38:39 +09:00
Issue #65 - Remove AppConstants from toolkit/prompts/content/tabprompts.xml
This file not only somehow escaped my pass through here but was also mocking me by using AppConstants in a preprocessed file BUT ALSO right AFTER a preprocessor directive.
This commit is contained in:
parent
fc8c7f8f85
commit
e8e7f40710
1 changed files with 13 additions and 15 deletions
|
|
@ -323,21 +323,19 @@
|
|||
let bnum = this.args.defaultButtonNum || 0;
|
||||
let defaultButton = this.ui["button" + bnum];
|
||||
|
||||
let { AppConstants } =
|
||||
Components.utils.import("resource://gre/modules/AppConstants.jsm", {});
|
||||
if (AppConstants.platform == "macosx") {
|
||||
// On OS X, the default button always stays marked as such (until
|
||||
// the entire prompt blurs).
|
||||
defaultButton.setAttribute("default", true);
|
||||
} else {
|
||||
// On other platforms, the default button is only marked as such
|
||||
// when no other button has focus. XUL buttons on not-OSX will
|
||||
// react to pressing enter as a command, so you can't trigger the
|
||||
// default without tabbing to it or something that isn't a button.
|
||||
let focusedDefault = (event.originalTarget == defaultButton);
|
||||
let someButtonFocused = event.originalTarget instanceof Ci.nsIDOMXULButtonElement;
|
||||
defaultButton.setAttribute("default", focusedDefault || !someButtonFocused);
|
||||
}
|
||||
#ifdef XP_MACOSX
|
||||
// On OS X, the default button always stays marked as such (until
|
||||
// the entire prompt blurs).
|
||||
defaultButton.setAttribute("default", true);
|
||||
#else
|
||||
// On other platforms, the default button is only marked as such
|
||||
// when no other button has focus. XUL buttons on not-OSX will
|
||||
// react to pressing enter as a command, so you can't trigger the
|
||||
// default without tabbing to it or something that isn't a button.
|
||||
let focusedDefault = (event.originalTarget == defaultButton);
|
||||
let someButtonFocused = event.originalTarget instanceof Ci.nsIDOMXULButtonElement;
|
||||
defaultButton.setAttribute("default", focusedDefault || !someButtonFocused);
|
||||
#endif
|
||||
</handler>
|
||||
<handler event="blur">
|
||||
// If focus shifted to somewhere else in the browser, don't make
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue