зеркало из https://github.com/mozilla/gecko-dev.git
Bug 948805 - Fix TypeError: this._toolbox is null: StyleEditorPanel.prototype._showError; r=pbrosset
This commit is contained in:
Родитель
0318016b40
Коммит
e5ea99cfe3
|
@ -72,15 +72,26 @@ StyleEditorPanel.prototype = {
|
|||
*
|
||||
* @param {string} event
|
||||
* Type of event
|
||||
* @param {string} errorCode
|
||||
* @param {string} code
|
||||
* Error code of error to report
|
||||
* @param {string} message
|
||||
* Extra message to append to error message
|
||||
*/
|
||||
_showError: function(event, errorCode) {
|
||||
let message = _(errorCode);
|
||||
_showError: function(event, code, message) {
|
||||
if (!this._toolbox) {
|
||||
// could get an async error after we've been destroyed
|
||||
return;
|
||||
}
|
||||
|
||||
let errorMessage = _(code);
|
||||
if (message) {
|
||||
errorMessage += " " + message;
|
||||
}
|
||||
|
||||
let notificationBox = this._toolbox.getNotificationBox();
|
||||
let notification = notificationBox.getNotificationWithValue("styleeditor-error");
|
||||
if (!notification) {
|
||||
notificationBox.appendNotification(message,
|
||||
notificationBox.appendNotification(errorMessage,
|
||||
"styleeditor-error", "", notificationBox.PRIORITY_CRITICAL_LOW);
|
||||
}
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче