Commit 15da544e authored by Romain Courteaud's avatar Romain Courteaud

[erp5_xhtml_style] ckeditor: make is responsive as soon as possible

parent 40f6c8fe
...@@ -128,6 +128,7 @@ ...@@ -128,6 +128,7 @@
}) })
.declareMethod('render', function (options) { .declareMethod('render', function (options) {
this.listenToResize();
return this.changeState({ return this.changeState({
key: options.key, key: options.key,
value: options.value || "", value: options.value || "",
...@@ -136,7 +137,8 @@ ...@@ -136,7 +137,8 @@
configuration_mobile: options.configuration_mobile || configuration_mobile: options.configuration_mobile ||
MOBILE_CONFIGURATION, MOBILE_CONFIGURATION,
is_responsive: (options.configuration_mobile !== undefined) || is_responsive: (options.configuration_mobile !== undefined) ||
(options.configuration === undefined) (options.configuration === undefined),
is_mobile: MATCH_MEDIA.matches
}); });
}) })
...@@ -190,7 +192,7 @@ ...@@ -190,7 +192,7 @@
} }
}) })
.declareService(function () { .declareJob('listenToResize', function () {
var result, var result,
event, event,
context = this; context = this;
...@@ -204,12 +206,8 @@ ...@@ -204,12 +206,8 @@
is_mobile: false is_mobile: false
}); });
} }
result = loopEventListener(window, 'resize', false, return loopEventListener(window, 'resize', false,
extractSizeAndDispatch); extractSizeAndDispatch);
event = document.createEvent("Event");
event.initEvent('resize', true, true);
window.dispatchEvent(event);
return result;
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment