fix opening links in attr detail

This commit is contained in:
zadam 2020-08-19 17:59:55 +02:00
parent 5741b380f0
commit 3c224e80ee
4 changed files with 16 additions and 16 deletions

14
package-lock.json generated
View File

@ -1882,7 +1882,7 @@
},
"readable-stream": {
"version": "1.1.14",
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
"integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
"requires": {
"core-util-is": "~1.0.0",
@ -2930,7 +2930,7 @@
},
"readable-stream": {
"version": "1.1.14",
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
"integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
"requires": {
"core-util-is": "~1.0.0",
@ -5997,7 +5997,7 @@
},
"minimist": {
"version": "1.2.0",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
},
"minipass": {
@ -6118,7 +6118,7 @@
},
"mkdirp": {
"version": "0.5.1",
"resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"requires": {
"minimist": "0.0.8"
@ -6126,7 +6126,7 @@
"dependencies": {
"minimist": {
"version": "0.0.8",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
}
}
@ -7067,7 +7067,7 @@
},
"readable-stream": {
"version": "2.3.6",
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"requires": {
"core-util-is": "~1.0.0",
@ -8145,7 +8145,7 @@
},
"strip-ansi": {
"version": "3.0.1",
"resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"requires": {
"ansi-regex": "^2.0.0"

View File

@ -83,9 +83,6 @@ function goToLink(e) {
const activeTabContext = appContext.tabManager.getActiveTabContext();
activeTabContext.setNote(notePath);
}
else {
return false;
}
}
else {
if (e.which === 1) {
@ -95,9 +92,6 @@ function goToLink(e) {
window.open(address, '_blank');
}
}
else {
return false;
}
}
return true;
@ -132,7 +126,8 @@ function linkContextMenu(e) {
});
}
$(document).on('mousedown', "a", goToLink);
$(document).on('click', "a", goToLink);
$(document).on('auxclick', "a", goToLink); // to handle middle button
$(document).on('contextmenu', 'a', linkContextMenu);
export default {

View File

@ -52,6 +52,10 @@ const TPL = `
display: flex;
margin-top: 15px;
}
.attr-detail input[readonly] {
background-color: var(--accented-background-color) !important;
}
</style>
<div style="display: flex; justify-content: space-between;">
@ -265,7 +269,8 @@ export default class AttributeDetailWidget extends TabAwareWidget {
$(window).on('mouseup', e => {
if (!$(e.target).closest(this.$widget[0]).length
&& !$(e.target).closest(".algolia-autocomplete").length) {
&& !$(e.target).closest(".algolia-autocomplete").length
&& !$(e.target).closest("#context-menu-container").length) {
this.hide();
}
});

View File

@ -34,7 +34,7 @@ const TPL = `
.add-new-attribute-button {
color: var(--muted-text-color);
position: absolute;
bottom: 3px;
bottom: 2px;
right: 0;
cursor: pointer;
border: 1px solid transparent;