зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1551312 - allow customized built-in buttons to be passed to notificationbox r=bgrins
Allow customized built-in buttons to be used for the notificationbox buttons. This way e.g. <button type=menu-button> can be used there. Differential Revision: https://phabricator.services.mozilla.com/D30971 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
b9aa7fec86
Коммит
beeeb16b58
|
@ -99,6 +99,9 @@ MozElements.NotificationBox = class NotificationBox {
|
|||
* popup:
|
||||
* If specified, the button will open the popup element with this
|
||||
* ID, anchored to the button. This is alternative to "callback".
|
||||
* is:
|
||||
* Defines a Custom Element name to use as the "is" value on
|
||||
* button creation.
|
||||
* }
|
||||
* @param aEventCallback
|
||||
* This may be called with the "removed" or "dismissed" parameter.
|
||||
|
@ -148,7 +151,8 @@ MozElements.NotificationBox = class NotificationBox {
|
|||
if (aButtons) {
|
||||
for (var b = 0; b < aButtons.length; b++) {
|
||||
var button = aButtons[b];
|
||||
var buttonElem = document.createXULElement("button");
|
||||
var buttonElem = document.createXULElement("button",
|
||||
button.is ? { is: button.is } : {});
|
||||
|
||||
if (button["l10n-id"]) {
|
||||
buttonElem.setAttribute("data-l10n-id", button["l10n-id"]);
|
||||
|
|
Загрузка…
Ссылка в новой задаче