This commit is contained in:
Mirco Wittrien 2020-05-15 08:57:04 +02:00
parent e0bbeb666a
commit 341017deed
5 changed files with 6 additions and 8 deletions

View File

@ -283,11 +283,13 @@
}; };
BDFDB.PluginUtils.addLoadingIcon = function (icon) { BDFDB.PluginUtils.addLoadingIcon = function (icon) {
if (!Node.prototype.isPrototypeOf(icon)) return; if (!Node.prototype.isPrototypeOf(icon)) return;
let app = document.querySelector(BDFDB.dotCN.app);
if (!app) return;
BDFDB.DOMUtils.addClass(icon, BDFDB.disCN.loadingicon); BDFDB.DOMUtils.addClass(icon, BDFDB.disCN.loadingicon);
let loadingIconWrapper = document.querySelector(BDFDB.dotCN.app + ">" + BDFDB.dotCN.loadingiconwrapper); let loadingIconWrapper = document.querySelector(BDFDB.dotCN.app + ">" + BDFDB.dotCN.loadingiconwrapper)
if (!loadingIconWrapper) { if (!loadingIconWrapper) {
loadingIconWrapper = BDFDB.DOMUtils.create(`<div class="${BDFDB.disCN.loadingiconwrapper}"></div>`); loadingIconWrapper = BDFDB.DOMUtils.create(`<div class="${BDFDB.disCN.loadingiconwrapper}"></div>`);
document.querySelector(BDFDB.dotCN.app).appendChild(loadingIconWrapper); app.appendChild(loadingIconWrapper);
let killObserver = new MutationObserver(changes => {if (!loadingIconWrapper.firstElementChild) BDFDB.DOMUtils.remove(loadingIconWrapper);}); let killObserver = new MutationObserver(changes => {if (!loadingIconWrapper.firstElementChild) BDFDB.DOMUtils.remove(loadingIconWrapper);});
killObserver.observe(loadingIconWrapper, {childList:true}); killObserver.observe(loadingIconWrapper, {childList:true});
} }
@ -3373,7 +3375,7 @@
}; };
BDFDB.ContextMenuUtils.close = function (nodeOrInstance) { BDFDB.ContextMenuUtils.close = function (nodeOrInstance) {
if (!BDFDB.ObjectUtils.is(nodeOrInstance)) return; if (!BDFDB.ObjectUtils.is(nodeOrInstance)) return;
var instance = BDFDB.ReactUtils.findOwner(nodeOrInstance, {props:"closeContextMenu", up:true}); let instance = BDFDB.ReactUtils.findOwner(nodeOrInstance, {props:"closeContextMenu", up:true});
if (BDFDB.ObjectUtils.is(instance) && instance.props && typeof instance.props.closeContextMenu == "function") instance.props.closeContextMenu(); if (BDFDB.ObjectUtils.is(instance) && instance.props && typeof instance.props.closeContextMenu == "function") instance.props.closeContextMenu();
else BDFDB.LibraryModules.ContextMenuUtils.closeContextMenu(); else BDFDB.LibraryModules.ContextMenuUtils.closeContextMenu();
}; };

File diff suppressed because one or more lines are too long

View File

@ -105,7 +105,6 @@ var CopyRawMessage = (_ => {
}); });
}, },
action: _ => { action: _ => {
e.instance.props.onClose();
BDFDB.LibraryRequires.electron.clipboard.write({text:e.instance.props.message.content}); BDFDB.LibraryRequires.electron.clipboard.write({text:e.instance.props.message.content});
} }
})); }));

View File

@ -231,7 +231,6 @@ var GoogleTranslateOption = (_ => {
}); });
}, },
action: _ => { action: _ => {
e.instance.props.onClose();
this.translateMessage(e.instance.props.message, e.instance.props.channel); this.translateMessage(e.instance.props.message, e.instance.props.channel);
} }
})); }));

View File

@ -139,7 +139,6 @@ var PersonalPins = (_ => {
}); });
}, },
action: _ => { action: _ => {
e.instance.props.onClose();
this.addMessageToNotes(e.instance.props.message, e.instance.props.channel); this.addMessageToNotes(e.instance.props.message, e.instance.props.channel);
} }
})); }));
@ -154,7 +153,6 @@ var PersonalPins = (_ => {
}); });
}, },
action: _ => { action: _ => {
e.instance.props.onClose();
this.updateNoteData(note, e.instance.props.message); this.updateNoteData(note, e.instance.props.message);
} }
})); }));