[bug] fix add link item missing first option

This commit is contained in:
zombieFox 2020-07-19 18:00:43 +01:00
parent 6f565c9564
commit ebfc33d8a1
5 changed files with 10 additions and 7 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "nightTab",
"version": "5.55.0",
"version": "5.55.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "nightTab",
"version": "5.55.0",
"version": "5.55.1",
"description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
"main": "index.js",
"scripts": {

View File

@ -2304,13 +2304,15 @@ var link = (function() {
};
var makePostionOptions = function() {
if (stagedLink.position.destination.item > 0) {
if (bookmarks.get().length > 0) {
while (groupExistingPosition.lastChild) {
groupExistingPosition.removeChild(groupExistingPosition.lastChild);
};
var optionCount = 0;
if (stagedLink.position.destination.item > 0) {
if (stagedLink.position.destination.item >= 0) {
if (options.useStagedLink && stagedLink.position.origin.group == stagedLink.position.destination.group) {
optionCount = optionCount + bookmarks.get()[stagedLink.position.origin.group].items.length;
} else {
@ -2319,10 +2321,11 @@ var link = (function() {
} else {
optionCount = 1;
};
for (var i = 1; i <= optionCount; i++) {
groupExistingPosition.appendChild(helper.node("option:" + helper.ordinalNumber(i)));
if (optionCount == i) {
groupExistingPosition.selectedIndex = i - 1;
groupExistingPosition.selectedIndex = (i - 1);
}
};

View File

@ -1,6 +1,6 @@
var version = (function() {
var current = "5.55.0";
var current = "5.55.1";
var name = "Jaded Raven";

View File

@ -2,7 +2,7 @@
"name": "nightTab",
"short_name": "nightTab",
"description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
"version": "5.55.0",
"version": "5.55.1",
"manifest_version": 2,
"chrome_url_overrides": {
"newtab": "index.html"