From 97dd4ab8871891bcf8989ec225f5438704884c8d Mon Sep 17 00:00:00 2001
From: Daniil Kostin
Date: Mon, 14 May 2018 12:45:36 +0300
Subject: [PATCH 1/2] Fix QResizeObservable: start immediately instead debounce
pause
---
src/components/observables/QResizeObservable.js | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/components/observables/QResizeObservable.js b/src/components/observables/QResizeObservable.js
index 22d349ca41c..970ca9c3456 100644
--- a/src/components/observables/QResizeObservable.js
+++ b/src/components/observables/QResizeObservable.js
@@ -35,7 +35,10 @@ export default {
this.size = size
this.$emit('resize', this.size)
},
- trigger () {
+ trigger (immediately) {
+ if (immediately) {
+ this.onResize()
+ }
if (this.debounce === 0) {
this.onResize()
}
@@ -59,7 +62,7 @@ export default {
on: {
load: () => {
this.$el.contentDocument.defaultView.addEventListener('resize', this.trigger, listenOpts.passive)
- this.trigger()
+ this.trigger(true)
}
}
})
@@ -79,7 +82,7 @@ export default {
return
}
- this.trigger()
+ this.trigger(true)
if (this.$q.platform.is.ie) {
this.url = 'about:blank'
From b106d1188eb13f913d51ecd589f30dd0a591c828 Mon Sep 17 00:00:00 2001
From: Razvan Stoenescu
Date: Mon, 14 May 2018 13:08:34 +0300
Subject: [PATCH 2/2] Update QResizeObservable.js
---
src/components/observables/QResizeObservable.js | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/components/observables/QResizeObservable.js b/src/components/observables/QResizeObservable.js
index 970ca9c3456..309bd432e60 100644
--- a/src/components/observables/QResizeObservable.js
+++ b/src/components/observables/QResizeObservable.js
@@ -36,10 +36,7 @@ export default {
this.$emit('resize', this.size)
},
trigger (immediately) {
- if (immediately) {
- this.onResize()
- }
- if (this.debounce === 0) {
+ if (immediately || this.debounce === 0) {
this.onResize()
}
else if (!this.timer) {