mirror of
https://github.com/zombieFox/nightTab.git
synced 2025-06-30 14:21:05 +02:00
fix bookmark edge not updating after changing style, orientation or sorting
This commit is contained in:
@ -82,9 +82,7 @@ bookmarkSetting.disable = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
bookmarkSetting.edge = {
|
bookmarkSetting.edge = {
|
||||||
general: {},
|
general: {}
|
||||||
style: {},
|
|
||||||
orientation: {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
bookmarkSetting.general = (parent) => {
|
bookmarkSetting.general = (parent) => {
|
||||||
@ -286,6 +284,20 @@ bookmarkSetting.style = (parent) => {
|
|||||||
|
|
||||||
groupAndBookmark.render();
|
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();
|
data.save();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -310,8 +322,25 @@ bookmarkSetting.orientation = (parent) => {
|
|||||||
groupName: 'bookmark-orientation',
|
groupName: 'bookmark-orientation',
|
||||||
path: 'bookmark.orientation',
|
path: 'bookmark.orientation',
|
||||||
action: () => {
|
action: () => {
|
||||||
|
|
||||||
applyCSSClass('bookmark.orientation');
|
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();
|
data.save();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -334,9 +363,27 @@ bookmarkSetting.sort = (parent) => {
|
|||||||
text: 'By letter',
|
text: 'By letter',
|
||||||
style: ['line'],
|
style: ['line'],
|
||||||
func: () => {
|
func: () => {
|
||||||
|
|
||||||
bookmark.item.mod.sort.letter();
|
bookmark.item.mod.sort.letter();
|
||||||
|
|
||||||
groupAndBookmark.render();
|
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();
|
data.save();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -344,9 +391,27 @@ bookmarkSetting.sort = (parent) => {
|
|||||||
text: 'By icon',
|
text: 'By icon',
|
||||||
style: ['line'],
|
style: ['line'],
|
||||||
func: () => {
|
func: () => {
|
||||||
|
|
||||||
bookmark.item.mod.sort.icon();
|
bookmark.item.mod.sort.icon();
|
||||||
|
|
||||||
groupAndBookmark.render();
|
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();
|
data.save();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -354,9 +419,27 @@ bookmarkSetting.sort = (parent) => {
|
|||||||
text: 'By name',
|
text: 'By name',
|
||||||
style: ['line'],
|
style: ['line'],
|
||||||
func: () => {
|
func: () => {
|
||||||
|
|
||||||
bookmark.item.mod.sort.name();
|
bookmark.item.mod.sort.name();
|
||||||
|
|
||||||
groupAndBookmark.render();
|
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();
|
data.save();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user