mirror of
https://github.com/zombieFox/nightTab.git
synced 2025-06-26 04:21:38 +02:00
[bug] fix link focus on edit or remove
This commit is contained in:
parent
37a7005c42
commit
16e90f5289
@ -54,6 +54,7 @@
|
|||||||
.link-item:hover {
|
.link-item:hover {
|
||||||
transform: scale(1.05);
|
transform: scale(1.05);
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
|
outline: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.link-item:active {
|
.link-item:active {
|
||||||
|
40
js/link.js
40
js/link.js
@ -4,8 +4,17 @@ var link = (function() {
|
|||||||
|
|
||||||
var _returnToPreviousFocusLink = function() {
|
var _returnToPreviousFocusLink = function() {
|
||||||
if (_previousFocusLink != null) {
|
if (_previousFocusLink != null) {
|
||||||
helper.eA(".link-panel-back")[_previousFocusLink].querySelectorAll(".link-control-item")[0].focus();
|
var linkPanelFront = helper.eA(".link-panel-front");
|
||||||
_previousFocusLink = null
|
if (linkPanelFront.length > 0) {
|
||||||
|
if (_previousFocusLink >= 0) {
|
||||||
|
linkPanelFront[_previousFocusLink].focus();
|
||||||
|
} else {
|
||||||
|
linkPanelFront[0].focus();
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
helper.e("body").focus();
|
||||||
|
};
|
||||||
|
_previousFocusLink = null;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -129,11 +138,26 @@ var link = (function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var remove = function(bookmarkData) {
|
var remove = function(bookmarkData) {
|
||||||
|
modal.render({
|
||||||
|
heading: "Remove " + bookmarkData.name + " bookmark",
|
||||||
|
content: "Are you sure you want to remove this bookmark? This can not be undone.",
|
||||||
|
successAction: function() {
|
||||||
|
_previousFocusLink = _previousFocusLink - 1;
|
||||||
bookmarks.remove(bookmarkData);
|
bookmarks.remove(bookmarkData);
|
||||||
_checkCount();
|
_checkCount();
|
||||||
data.save();
|
data.save();
|
||||||
clear();
|
clear();
|
||||||
render.item.all();
|
render.item.all();
|
||||||
|
control.dependents();
|
||||||
|
control.render();
|
||||||
|
_returnToPreviousFocusLink();
|
||||||
|
},
|
||||||
|
cancelAction: function() {
|
||||||
|
_returnToPreviousFocusLink();
|
||||||
|
},
|
||||||
|
actionText: "Remove",
|
||||||
|
size: "small"
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var _checkCount = function() {
|
var _checkCount = function() {
|
||||||
@ -438,18 +462,8 @@ var link = (function() {
|
|||||||
edit(data);
|
edit(data);
|
||||||
}, false);
|
}, false);
|
||||||
linkRemove.addEventListener("click", function() {
|
linkRemove.addEventListener("click", function() {
|
||||||
modal.render({
|
_previousFocusLink = index;
|
||||||
heading: "Remove " + data.name + " bookmark",
|
|
||||||
content: "Are you sure you want to remove this bookmark? This can not be undone.",
|
|
||||||
successAction: function() {
|
|
||||||
remove(data);
|
remove(data);
|
||||||
control.dependents();
|
|
||||||
control.render();
|
|
||||||
},
|
|
||||||
actionText: "Remove",
|
|
||||||
cancelText: "Cancel",
|
|
||||||
size: "small"
|
|
||||||
});
|
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
return linkItem;
|
return linkItem;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
var version = (function() {
|
var version = (function() {
|
||||||
|
|
||||||
// version is normally bumped when the state needs changing or any new functionality is added
|
// version is normally bumped when the state needs changing or any new functionality is added
|
||||||
var current = "3.10.2";
|
var current = "3.10.3";
|
||||||
|
|
||||||
var compare = function(a, b) {
|
var compare = function(a, b) {
|
||||||
var pa = a.split(".");
|
var pa = a.split(".");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user