Skip to content

Commit a0b94b6

Browse files
committed
Update buttons when the title changes, v2.18.3
1 parent c547483 commit a0b94b6

File tree

4 files changed

+27
-7
lines changed

4 files changed

+27
-7
lines changed

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [2.18.3] - 2025-01-15
11+
12+
### Fixed
13+
14+
- `BButton`:
15+
- Update buttons when the title changes
16+
- Don't show tooltip when empty
17+
- Fixed positioning
18+
1019
## [2.18.2] - 2025-01-15
1120

1221
### Added
@@ -699,6 +708,7 @@ Please see the [Releases](https://github.com/Open-EO/openeo-vue-components/relea
699708

700709

701710
[Unreleased]: https://github.com/Open-EO/openeo-vue-components/compare/v2.18.2...HEAD
711+
[2.18.3]: https://github.com/Open-EO/openeo-vue-components/compare/v2.18.2...v2.18.3
702712
[2.18.2]: https://github.com/Open-EO/openeo-vue-components/compare/v2.18.1...v2.18.2
703713
[2.18.1]: https://github.com/Open-EO/openeo-vue-components/compare/v2.18.0...v2.18.1
704714
[2.18.0]: https://github.com/Open-EO/openeo-vue-components/compare/v2.17.1...v2.18.0

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A set of [Vue](https://vuejs.org) components for [openEO](http://openeo.org).
44

5-
This library's version is [**2.18.2**](CHANGELOG.md) and supports **openEO API versions 1.x.x**.
5+
This library's version is [**2.18.3**](CHANGELOG.md) and supports **openEO API versions 1.x.x**.
66
Legacy versions supporting API version 0.x are available as [releases](https://github.com/Open-EO/openeo-vue-components/releases).
77

88
npm: [@openeo/vue-components](https://www.npmjs.com/package/@openeo/vue-components)

components/internal/BButton.vue

+15-5
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default {
4848
};
4949
},
5050
mounted() {
51-
this.container = document.getElementsByName('body')[0];
51+
this.container = document.getElementsByTagName('body')[0];
5252
if (!this.container) {
5353
this.container = this.$refs.button.parentNode;
5454
if (!this.container) {
@@ -78,26 +78,35 @@ export default {
7878
else {
7979
this.removeTooltip();
8080
}
81+
},
82+
title() {
83+
if (this.title) {
84+
this.updateTooltip();
85+
}
86+
else {
87+
this.showTooltip = false;
88+
}
8189
}
8290
},
8391
methods: {
8492
createTooltip() {
85-
if (!this.container) {
93+
if (!this.container || !this.title) {
8694
return;
8795
}
8896
if (this.element) {
8997
this.removeTooltip();
9098
}
9199
this.element = document.createElement('div');
92100
this.element.className = 'openeo-vue-tooltip';
93-
this.element.innerText = this.title;
101+
this.element.addEventListener('mouseover', () => this.showTooltip = false);
94102
this.container.appendChild(this.element);
95103
this.updateTooltip();
96104
},
97105
updateTooltip() {
98106
if (!this.element) {
99107
return;
100108
}
109+
this.element.innerText = this.title;
101110
const el = this.$refs.button;
102111
const pos = el.getBoundingClientRect();
103112
this.element.style.top = Math.max(0, (pos.top + el.offsetHeight)) + 1 + 'px';
@@ -107,10 +116,10 @@ export default {
107116
if (!this.container || !this.element) {
108117
return;
109118
}
110-
document.removeEventListener('scroll', this.removeTooltip);
111119
if (this.container.contains(this.element)) {
112120
this.container.removeChild(this.element);
113121
}
122+
this.element = null;
114123
},
115124
click(event) {
116125
this.$emit('click', event);
@@ -147,9 +156,10 @@ export default {
147156
color: white;
148157
padding: 5px;
149158
border-radius: 5px;
150-
z-index: 1000;
159+
z-index: 9999;
151160
font-size: 0.9em;
152161
border: 1px solid #000;
153162
text-align: center;
163+
max-width: 250px;
154164
}
155165
</style>

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openeo/vue-components",
3-
"version": "2.18.2",
3+
"version": "2.18.3",
44
"author": "openEO Consortium",
55
"contributors": [
66
{

0 commit comments

Comments
 (0)