This commit is contained in:
Mirco Wittrien 2020-06-12 15:23:14 +02:00
parent 6e43492f9d
commit 587cd55470
2 changed files with 6 additions and 7 deletions

View File

@ -39,7 +39,7 @@ var CustomQuoter = (_ => {
return class CustomQuoter {
getName () {return "CustomQuoter";}
getVersion () {return "1.0.9";}
getVersion () {return "1.1.0";}
getAuthor () {return "DevilBro";}
@ -62,8 +62,6 @@ var CustomQuoter = (_ => {
getSettingsPanel (collapseStates = {}) {
if (!window.BDFDB || typeof BDFDB != "object" || !BDFDB.loaded || !this.started) return;
let settings = BDFDB.DataUtils.get(this, "settings");
let formats = BDFDB.DataUtils.get(this, "formats");
let settingsPanel, settingsItems = [], innerItems = [];
for (let key in settings) innerItems.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SettingsSaveItem, {
@ -73,8 +71,8 @@ var CustomQuoter = (_ => {
keys: ["settings", key],
label: this.defaults.settings[key].description,
value: settings[key],
onChange: (e, instance) => {
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(BDFDB.ReactUtils.findOwner(instance, {name:"BDFDB_SettingsPanel", up:true}), {name:"BDFDB_Select", all:true, noCopies:true}));
onChange: (value, instance) => {
settings[key] = value;
}
}));
@ -94,7 +92,8 @@ var CustomQuoter = (_ => {
label: this.defaults.formats[key].description,
basis: "70%",
value: formats[key],
onChange: (e, instance) => {
onChange: (value, instance) => {
formats[key] = value;
BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(instance._reactInternalFiber.return, {key:"PREVIEW_MESSAGE"}));
}
}));

View File

@ -53,7 +53,7 @@ var ThemeSettings = (_ => {
let cardObserver = (new MutationObserver(changes => {changes.forEach(change => {if (change.addedNodes) {change.addedNodes.forEach(node => {
if (BDFDB.DOMUtils.containsClass(node, BDFDB.disCN._repocard)) this.appendSettingsButton(node);
for (let child of node.querySelectorAll(BDFDB.dotCN._repocard)) this.appendSettingsButton(child);
if (node.nodeType != Node.TEXT_NODE) for (let child of node.querySelectorAll(BDFDB.dotCN._repocard)) this.appendSettingsButton(child);
});}});}));
BDFDB.ObserverUtils.connect(this, document.querySelector("#user-settings"), {name:"cardObserver", instance:cardObserver}, {childList: true, subtree:true});
BDFDB.ObserverUtils.connect(this, BDFDB.dotCN.applayers, {name:"appLayerObserver", instance:(new MutationObserver(changes => {changes.forEach(change => {if (change.addedNodes) {change.addedNodes.forEach(node => {