Compare commits

...

3 Commits

Author SHA1 Message Date
Raphael Michel
5bc92a9f04 Bump to 4.18.2 2023-03-29 11:05:35 +02:00
Richard Schreiber
1de57aaa80 Widget: fix default-open variations being hidden (Z#23118652) 2023-03-29 11:05:35 +02:00
Raphael Michel
6ae2fa5964 Bump to 4.18.1 2023-03-29 11:05:32 +02:00
2 changed files with 18 additions and 24 deletions

View File

@@ -19,4 +19,4 @@
# You should have received a copy of the GNU Affero General Public License along with this program. If not, see
# <https://www.gnu.org/licenses/>.
#
__version__ = "4.19.0.dev0"
__version__ = "4.18.2"

View File

@@ -482,33 +482,27 @@ Vue.component('item', {
expanded: this.$root.show_variations_expanded
};
},
watch: {
expanded: function (newValue) {
var v = this.$refs.variations;
if (newValue) {
v.hidden = false;
} else {
// Vue.nextTick does not work here
window.setTimeout(function () {
v.style.maxHeight = 0;
}, 50);
}
v.style.maxHeight = v.scrollHeight + 'px';
}
},
mounted: function () {
if (this.$refs.variations) {
this.$refs.variations.hidden = !this.expanded;
if (!this.expanded) {
this.$refs.variations.style.maxHeight = '0px';
var $this = this;
this.$refs.variations.hidden = true;
this.$refs.variations.addEventListener('transitionend', function (event) {
if (event.target == this) {
this.hidden = !$this.expanded;
this.style.maxHeight = 'none';
}
});
this.$watch('expanded', function (newValue) {
var v = this.$refs.variations;
v.hidden = false;
v.style.maxHeight = (newValue ? 0 : v.scrollHeight) + 'px';
// Vue.nextTick does not work here
window.setTimeout(function () {
v.style.maxHeight = (!newValue ? 0 : v.scrollHeight) + 'px';
}, 50);
})
}
this.$refs.variations.addEventListener('transitionend', function (event) {
if (this.style.maxHeight && this.style.maxHeight != '0px') {
this.style.maxHeight = 'none';
} else {
this.hidden = true;
}
});
}
},
methods: {