mirror of
https://github.com/zombieFox/nightTab.git
synced 2025-06-26 20:41:21 +02:00
[bug] fix new links with new groups from not being added
This commit is contained in:
parent
d543781133
commit
4540b6dae9
@ -211,6 +211,7 @@ var bookmarks = (function() {
|
|||||||
|
|
||||||
mod.add = {
|
mod.add = {
|
||||||
link: function(data) {
|
link: function(data) {
|
||||||
|
console.log(data);
|
||||||
if (data.position.group.new) {
|
if (data.position.group.new) {
|
||||||
mod.add.group({
|
mod.add.group({
|
||||||
position: {
|
position: {
|
||||||
@ -218,7 +219,13 @@ var bookmarks = (function() {
|
|||||||
destination: data.position.destination.group
|
destination: data.position.destination.group
|
||||||
},
|
},
|
||||||
group: {
|
group: {
|
||||||
name: data.position.group.name,
|
name: {
|
||||||
|
text: data.position.group.name.text,
|
||||||
|
show: data.position.group.name.show
|
||||||
|
},
|
||||||
|
openAll: {
|
||||||
|
show: data.position.group.openAll.show
|
||||||
|
},
|
||||||
items: []
|
items: []
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -232,17 +239,23 @@ var bookmarks = (function() {
|
|||||||
};
|
};
|
||||||
if (data) {
|
if (data) {
|
||||||
if (data.group.name == null) {
|
if (data.group.name == null) {
|
||||||
data.group.name = makeName();
|
data.group.name.text = makeName();
|
||||||
} else if (typeof data.group.name == "string") {
|
} else if (typeof data.group.name.text == "string") {
|
||||||
data.group.name = data.group.name.trim();
|
data.group.name.text = data.group.name.text.trim();
|
||||||
if (data.group.name == "") {
|
if (data.group.name.text == "") {
|
||||||
data.group.name = makeName();
|
data.group.name.text = makeName();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
mod.all.splice(data.position.destination, 0, data.group);
|
mod.all.splice(data.position.destination, 0, data.group);
|
||||||
} else {
|
} else {
|
||||||
mod.all.push({
|
mod.all.push({
|
||||||
name: makeName(),
|
name: {
|
||||||
|
text: makeName(),
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
openAll: {
|
||||||
|
show: true
|
||||||
|
},
|
||||||
items: []
|
items: []
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -44,7 +44,13 @@ var link = (function() {
|
|||||||
},
|
},
|
||||||
group: {
|
group: {
|
||||||
new: null,
|
new: null,
|
||||||
name: null
|
name: {
|
||||||
|
text: null,
|
||||||
|
show: null
|
||||||
|
},
|
||||||
|
openAll: {
|
||||||
|
show: null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
link: {
|
link: {
|
||||||
@ -76,6 +82,8 @@ var link = (function() {
|
|||||||
stagedLink.position.destination.group = 0;
|
stagedLink.position.destination.group = 0;
|
||||||
stagedLink.position.destination.item = 0;
|
stagedLink.position.destination.item = 0;
|
||||||
stagedLink.position.group.new = false;
|
stagedLink.position.group.new = false;
|
||||||
|
stagedLink.position.group.name.show = false;
|
||||||
|
stagedLink.position.group.openAll.show = false;
|
||||||
stagedLink.link.display = "letter";
|
stagedLink.link.display = "letter";
|
||||||
stagedLink.link.accent.override = false;
|
stagedLink.link.accent.override = false;
|
||||||
stagedLink.link.searchMatch = false;
|
stagedLink.link.searchMatch = false;
|
||||||
@ -87,7 +95,7 @@ var link = (function() {
|
|||||||
stagedLink.position.destination.group = null;
|
stagedLink.position.destination.group = null;
|
||||||
stagedLink.position.destination.item = null;
|
stagedLink.position.destination.item = null;
|
||||||
stagedLink.position.group.new = null;
|
stagedLink.position.group.new = null;
|
||||||
stagedLink.position.group.name = null;
|
stagedLink.position.group.name.text = null;
|
||||||
stagedLink.link.display = null;
|
stagedLink.link.display = null;
|
||||||
stagedLink.link.letter = null;
|
stagedLink.link.letter = null;
|
||||||
stagedLink.link.icon.name = null;
|
stagedLink.link.icon.name = null;
|
||||||
@ -1143,6 +1151,8 @@ var link = (function() {
|
|||||||
groupExistingRadio.addEventListener("change", function(event) {
|
groupExistingRadio.addEventListener("change", function(event) {
|
||||||
stagedLink.position.destination.group = groupExistingGroup.selectedIndex;
|
stagedLink.position.destination.group = groupExistingGroup.selectedIndex;
|
||||||
stagedLink.position.group.new = false;
|
stagedLink.position.group.new = false;
|
||||||
|
stagedLink.position.group.name.show = false;
|
||||||
|
stagedLink.position.group.openAll.show = false;
|
||||||
groupExistingGroup.removeAttribute("disabled");
|
groupExistingGroup.removeAttribute("disabled");
|
||||||
groupExistingPosition.removeAttribute("disabled");
|
groupExistingPosition.removeAttribute("disabled");
|
||||||
helper.removeClass(groupExistingPositionLabel, "disabled");
|
helper.removeClass(groupExistingPositionLabel, "disabled");
|
||||||
@ -1160,6 +1170,8 @@ var link = (function() {
|
|||||||
groupNewRadio.addEventListener("change", function(event) {
|
groupNewRadio.addEventListener("change", function(event) {
|
||||||
stagedLink.position.destination.group = bookmarks.get().length;
|
stagedLink.position.destination.group = bookmarks.get().length;
|
||||||
stagedLink.position.group.new = true;
|
stagedLink.position.group.new = true;
|
||||||
|
stagedLink.position.group.name.show = true;
|
||||||
|
stagedLink.position.group.openAll.show = true;
|
||||||
groupExistingGroup.setAttribute("disabled", "");
|
groupExistingGroup.setAttribute("disabled", "");
|
||||||
groupExistingPosition.setAttribute("disabled", "");
|
groupExistingPosition.setAttribute("disabled", "");
|
||||||
helper.addClass(groupExistingPositionLabel, "disabled");
|
helper.addClass(groupExistingPositionLabel, "disabled");
|
||||||
@ -1167,13 +1179,13 @@ var link = (function() {
|
|||||||
groupNewRandomNameButton.removeAttribute("disabled");
|
groupNewRandomNameButton.removeAttribute("disabled");
|
||||||
}, false);
|
}, false);
|
||||||
groupNewInput.addEventListener("input", function(event) {
|
groupNewInput.addEventListener("input", function(event) {
|
||||||
stagedLink.position.group.name = this.value;
|
stagedLink.position.group.name.text = this.value;
|
||||||
}, false);
|
}, false);
|
||||||
groupNewRandomNameButton.addEventListener("click", function(event) {
|
groupNewRandomNameButton.addEventListener("click", function(event) {
|
||||||
var randomName = helper.randomString({
|
var randomName = helper.randomString({
|
||||||
mix: true
|
mix: true
|
||||||
});
|
});
|
||||||
stagedLink.position.group.name = randomName;
|
stagedLink.position.group.name.text = randomName;
|
||||||
groupNewInput.value = randomName;
|
groupNewInput.value = randomName;
|
||||||
}, false);
|
}, false);
|
||||||
displayLetterRadio.addEventListener("change", function(event) {
|
displayLetterRadio.addEventListener("change", function(event) {
|
||||||
@ -1323,7 +1335,7 @@ var link = (function() {
|
|||||||
stagedLink.position.origin.item = index;
|
stagedLink.position.origin.item = index;
|
||||||
stagedLink.position.destination.item = index;
|
stagedLink.position.destination.item = index;
|
||||||
stagedLink.position.group.new = null;
|
stagedLink.position.group.new = null;
|
||||||
stagedLink.position.group.name = null;
|
stagedLink.position.group.name.text = null;
|
||||||
if (state.get.current().search) {
|
if (state.get.current().search) {
|
||||||
if (stagedLink.link.searchMatch) {
|
if (stagedLink.link.searchMatch) {
|
||||||
group.querySelector(".group-body").appendChild(render.item.link());
|
group.querySelector(".group-body").appendChild(render.item.link());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user