fix bookmark edge not updating after changing style, orientation or sorting

This commit is contained in:
zombieFox 2021-09-04 12:14:29 +01:00
parent 91c44bc466
commit 8bb568d4e7

View File

@ -82,9 +82,7 @@ bookmarkSetting.disable = () => {
};
bookmarkSetting.edge = {
general: {},
style: {},
orientation: {}
general: {}
};
bookmarkSetting.general = (parent) => {
@ -286,6 +284,20 @@ bookmarkSetting.style = (parent) => {
groupAndBookmark.render();
if (bookmarkSetting.edge.general.size) {
if (state.get.current().bookmark.show && bookmark.tile.current.length > 0) {
bookmarkSetting.edge.general.size.update.primary(bookmark.tile.current[0].tile());
};
} else {
bookmarkSetting.edge.general.size = new Edge({ primary: bookmark.tile.current[0].tile(), secondary: [bookmark.element.area] });
};
data.save();
}
@ -310,8 +322,25 @@ bookmarkSetting.orientation = (parent) => {
groupName: 'bookmark-orientation',
path: 'bookmark.orientation',
action: () => {
applyCSSClass('bookmark.orientation');
if (bookmarkSetting.edge.general.size) {
if (state.get.current().bookmark.show && bookmark.tile.current.length > 0) {
bookmarkSetting.edge.general.size.update.primary(bookmark.tile.current[0].tile());
};
} else {
bookmarkSetting.edge.general.size = new Edge({ primary: bookmark.tile.current[0].tile(), secondary: [bookmark.element.area] });
};
data.save();
}
});
@ -334,9 +363,27 @@ bookmarkSetting.sort = (parent) => {
text: 'By letter',
style: ['line'],
func: () => {
bookmark.item.mod.sort.letter();
groupAndBookmark.render();
if (bookmarkSetting.edge.general.size) {
if (state.get.current().bookmark.show && bookmark.tile.current.length > 0) {
bookmarkSetting.edge.general.size.update.primary(bookmark.tile.current[0].tile());
};
} else {
bookmarkSetting.edge.general.size = new Edge({ primary: bookmark.tile.current[0].tile(), secondary: [bookmark.element.area] });
};
data.save();
}
});
@ -344,9 +391,27 @@ bookmarkSetting.sort = (parent) => {
text: 'By icon',
style: ['line'],
func: () => {
bookmark.item.mod.sort.icon();
groupAndBookmark.render();
if (bookmarkSetting.edge.general.size) {
if (state.get.current().bookmark.show && bookmark.tile.current.length > 0) {
bookmarkSetting.edge.general.size.update.primary(bookmark.tile.current[0].tile());
};
} else {
bookmarkSetting.edge.general.size = new Edge({ primary: bookmark.tile.current[0].tile(), secondary: [bookmark.element.area] });
};
data.save();
}
});
@ -354,9 +419,27 @@ bookmarkSetting.sort = (parent) => {
text: 'By name',
style: ['line'],
func: () => {
bookmark.item.mod.sort.name();
groupAndBookmark.render();
if (bookmarkSetting.edge.general.size) {
if (state.get.current().bookmark.show && bookmark.tile.current.length > 0) {
bookmarkSetting.edge.general.size.update.primary(bookmark.tile.current[0].tile());
};
} else {
bookmarkSetting.edge.general.size = new Edge({ primary: bookmark.tile.current[0].tile(), secondary: [bookmark.element.area] });
};
data.save();
}
});