tab/modal: force resize handlers to avoid blank canvas cached styles

This commit is contained in:
jean-emmanuel 2018-02-14 21:19:27 +01:00
parent edd087934e
commit 7589326171
3 changed files with 5 additions and 4 deletions

View file

@ -1,6 +1,6 @@
var elements = []
function checkResizes(context){
function checkResizes(context, force){
// Iterate over all elements to which the 'resize' event is bound.
var resizedElems = [],
cachedStyles = []
@ -17,7 +17,7 @@ function checkResizes(context){
// If element size has changed since the last time, update the element
// data store and trigger the 'resize' event.
if (width != elem.resizedataw || height != elem.resizedatah) {
if (force || width != elem.resizedataw || height != elem.resizedatah) {
elem.resizedataw = width
elem.resizedatah = height
resizedElems.push(elem)

View file

@ -1,5 +1,6 @@
var Panel = require('./panel'),
{icon, iconify} = require('../../ui/utils'),
resize = require('../../events/resize'),
doubletab = require('../mixins/double_tap')
@ -127,7 +128,7 @@ module.exports = class Modal extends Panel {
this.bindEscKey(this.value)
if (this.value) {
DOM.dispatchEvent(window, 'resize')
resize.check(this.widget, true)
}
if (this.init) this.fixParents()

View file

@ -68,7 +68,7 @@ module.exports = class Tab extends Panel {
this.container.appendChild(this.widget)
this.container.classList.add('show')
this.detached = false
resize.check(this.widget)
resize.check(this.widget, true)
}
onPropChanged(propName, options, oldPropValue) {