Skip to content

Commit

Permalink
prevent small flickering introduced by the new debounce mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bago committed May 25, 2022
1 parent 704175a commit 4ae5ad9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/js/bindings/wysiwygs.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,11 @@ ko.bindingHandlers.wysiwygSrc = {
var srcSetter = function(src, w, h, text, isPlaceholder) {
if (src == undefined || src == null || src == "") {
element.removeAttribute('src');
// when the current src is null we don't do preloading to avoid flickering (e.g on wizard button for sideimage block)
} else if (element.getAttribute('src') === null) {
element.setAttribute('src', src);
} else if (element.getAttribute('src') !== src) {
// when the current src is null we don't do preloading to avoid flickering (e.g on wizard button for sideimage block)
if (ko.bindingHandlers['wysiwygSrc'].preload && isWysiwygMode && element.getAttribute('src') !== null) {
if (ko.bindingHandlers['wysiwygSrc'].preload && isWysiwygMode) {
// if we are waiting for a remote placeholder, let's generate an SVG placeholder on the clientsize!
if (typeof ko.bindingHandlers.wysiwygSrc.svg == 'string' && isPlaceholder) {
var svgcode = ko.bindingHandlers.wysiwygSrc.svg.replace('__WIDTH__', w).replace('__HEIGHT__', h).replace('__TEXT__', text);
Expand Down

0 comments on commit 4ae5ad9

Please sign in to comment.