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 @@
})
.declareMethod('render', function (options) {
this.listenToResize();
return this.changeState({
key: options.key,
value: options.value || "",
......@@ -136,7 +137,8 @@
configuration_mobile: options.configuration_mobile ||
MOBILE_CONFIGURATION,
is_responsive: (options.configuration_mobile !== undefined) ||
(options.configuration === undefined)
(options.configuration === undefined),
is_mobile: MATCH_MEDIA.matches
});
})
......@@ -190,7 +192,7 @@
}
})
.declareService(function () {
.declareJob('listenToResize', function () {
var result,
event,
context = this;
......@@ -204,12 +206,8 @@
is_mobile: false
});
}
result = loopEventListener(window, 'resize', false,
return loopEventListener(window, 'resize', false,
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