mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Merge pull request #1496 from keepassxreboot/fix/notification_issue
Fix notification issues
This commit is contained in:
commit
f99dba382e
2 changed files with 10 additions and 1 deletions
|
|
@ -230,6 +230,10 @@ kpxcUI.createNotification = function(type, message) {
|
||||||
const styleSheet = createStylesheet('css/notification.css');
|
const styleSheet = createStylesheet('css/notification.css');
|
||||||
notificationWrapper = notificationWrapper || document.createElement('div');
|
notificationWrapper = notificationWrapper || document.createElement('div');
|
||||||
this.shadowRoot = notificationWrapper.attachShadow({ mode: 'closed' });
|
this.shadowRoot = notificationWrapper.attachShadow({ mode: 'closed' });
|
||||||
|
if (!this.shadowRoot) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.shadowRoot.append(styleSheet);
|
this.shadowRoot.append(styleSheet);
|
||||||
this.shadowRoot.append(notification);
|
this.shadowRoot.append(notification);
|
||||||
document.body.append(notificationWrapper);
|
document.body.append(notificationWrapper);
|
||||||
|
|
@ -325,7 +329,11 @@ Element.prototype.getLowerCaseAttribute = function(attr) {
|
||||||
|
|
||||||
Element.prototype._attachShadow = Element.prototype.attachShadow;
|
Element.prototype._attachShadow = Element.prototype.attachShadow;
|
||||||
Element.prototype.attachShadow = function () {
|
Element.prototype.attachShadow = function () {
|
||||||
return this._attachShadow({ mode: 'closed' });
|
try {
|
||||||
|
return this._attachShadow({ mode: 'closed' });
|
||||||
|
} catch (e) {
|
||||||
|
console.log('Error: ', e);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.prototype.shadowSelector = function(value) {
|
Object.prototype.shadowSelector = function(value) {
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,7 @@
|
||||||
"css/button.css",
|
"css/button.css",
|
||||||
"css/colors.css",
|
"css/colors.css",
|
||||||
"css/define.css",
|
"css/define.css",
|
||||||
|
"css/notification.css",
|
||||||
"css/pwgen.css",
|
"css/pwgen.css",
|
||||||
"css/username.css",
|
"css/username.css",
|
||||||
"css/totp.css"
|
"css/totp.css"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue