hide tooltip after clicking on a button, fixes #2228

This commit is contained in:
zadam 2021-10-13 23:05:47 +02:00
parent 6434889cd6
commit f505f9d65a
3 changed files with 31 additions and 23 deletions

40
package-lock.json generated
View file

@ -1,6 +1,6 @@
{
"name": "trilium",
"version": "0.48.0-beta",
"version": "0.48.1-beta",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -1606,16 +1606,16 @@
"integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow=="
},
"browserslist": {
"version": "4.17.3",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.3.tgz",
"integrity": "sha512-59IqHJV5VGdcJZ+GZ2hU5n4Kv3YiASzW6Xk5g9tf5a/MAzGeFwgGWU39fVzNIOVcgB3+Gp+kiQu0HEfTVU/3VQ==",
"version": "4.17.4",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.4.tgz",
"integrity": "sha512-Zg7RpbZpIJRW3am9Lyckue7PLytvVxxhJj1CaJVlCWENsGEAOlnlt8X0ZxGRPp7Bt9o8tIRM5SEXy4BCPMJjLQ==",
"dev": true,
"requires": {
"caniuse-lite": "^1.0.30001264",
"electron-to-chromium": "^1.3.857",
"caniuse-lite": "^1.0.30001265",
"electron-to-chromium": "^1.3.867",
"escalade": "^3.1.1",
"node-releases": "^1.1.77",
"picocolors": "^0.2.1"
"node-releases": "^2.0.0",
"picocolors": "^1.0.0"
}
},
"buffer": {
@ -3551,9 +3551,9 @@
}
},
"electron-to-chromium": {
"version": "1.3.864",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.864.tgz",
"integrity": "sha512-v4rbad8GO6/yVI92WOeU9Wgxc4NA0n4f6P1FvZTY+jyY7JHEhw3bduYu60v3Q1h81Cg6eo4ApZrFPuycwd5hGw==",
"version": "1.3.867",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.867.tgz",
"integrity": "sha512-WbTXOv7hsLhjJyl7jBfDkioaY++iVVZomZ4dU6TMe/SzucV6mUAs2VZn/AehBwuZMiNEQDaPuTGn22YK5o+aDw==",
"dev": true
},
"electron-window-state": {
@ -5844,9 +5844,9 @@
"dev": true
},
"node-releases": {
"version": "1.1.77",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.77.tgz",
"integrity": "sha512-rB1DUFUNAN4Gn9keO2K1efO35IDK7yKHCdCaIMvFO7yUYmmZYeDjnGKle26G4rwj+LKRQpjyUUvMkPglwGCYNQ==",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.0.tgz",
"integrity": "sha512-aA87l0flFYMzCHpTM3DERFSYxc6lv/BltdbRTOMZuxZ0cwZCD3mejE5n9vLhSJCN++/eOqr77G1IO5uXxlQYWA==",
"dev": true
},
"nopt": {
@ -6308,9 +6308,9 @@
"integrity": "sha512-CzFr90qM24ju5f88quFC/6qohjC144rehe5n6DH900lgXmUe86+xCKc10ev56gRKC4/BkHUoG4uSiQgBiIXwDA=="
},
"picocolors": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz",
"integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==",
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
"dev": true
},
"picomatch": {
@ -8030,9 +8030,9 @@
"integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g=="
},
"webpack": {
"version": "5.58.1",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.58.1.tgz",
"integrity": "sha512-4Z/dmbTU+VmkCb2XNgW7wkE5TfEcSooclprn/UEuVeAkwHhn07OcgUsyaKHGtCY/VobjnsYBlyhKeMLiSoOqPg==",
"version": "5.58.2",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.58.2.tgz",
"integrity": "sha512-3S6e9Vo1W2ijk4F4PPWRIu6D/uGgqaPmqw+av3W3jLDujuNkdxX5h5c+RQ6GkjVR+WwIPOfgY8av+j5j4tMqJw==",
"dev": true,
"requires": {
"@types/eslint-scope": "^3.7.0",

View file

@ -90,7 +90,7 @@
"jsdoc": "3.6.7",
"lorem-ipsum": "2.0.4",
"rcedit": "3.0.1",
"webpack": "5.58.1",
"webpack": "5.58.2",
"webpack-cli": "4.9.0"
},
"optionalDependencies": {

View file

@ -26,9 +26,17 @@ export default class ButtonWidget extends NoteContextAwareWidget {
this.$widget = $(TPL);
if (this.settings.onClick) {
this.$widget.on("click", () => this.settings.onClick(this));
this.$widget.on("click", () => {
this.$widget.tooltip("hide");
this.settings.onClick(this)
});
} else {
this.$widget.on("click", () => this.triggerCommand(this.settings.command));
this.$widget.on("click", () => {
this.$widget.tooltip("hide");
this.triggerCommand(this.settings.command)
});
}
this.$widget.attr("data-placement", this.settings.titlePlacement);