Работа над BookmarkSettings

This commit is contained in:
Book Pauk
2020-11-04 18:53:14 +07:00
parent f8c4960079
commit 27412211a5
3 changed files with 103 additions and 40 deletions

View File

@@ -20,7 +20,7 @@ export function removeOrigin(url) {
}
export function getRootIndexByUrl(groups, url) {
const origin = this.getOrigin(url);
const origin = getOrigin(url);
for (let i = 0; i < groups.length; i++) {
if (groups[i].r == origin)
return i;
@@ -28,6 +28,16 @@ export function getRootIndexByUrl(groups, url) {
return -1;
}
export function getSafeRootIndexByUrl(groups, url) {
let index = -1;
try {
index = getRootIndexByUrl(groups, url);
} catch(e) {
//
}
return index;
}
export function getListItemByLink(list, link) {
for (const item of list) {
if (item.l == link)