(js) Restore caret position in message editor

Fixes #4517
This commit is contained in:
Francis Lachapelle
2018-08-17 16:31:50 -04:00
parent e5d3c5fa33
commit f0b4e1b719
7 changed files with 161 additions and 9 deletions
+11
View File
@@ -81,6 +81,17 @@
ck = CKEDITOR.replace(elm[0], options);
if (attr.mdAutofocus && $parse(attr.mdAutofocus)($scope)) {
// Autofocus is enabled
ck.on('instanceReady', function(event) {
ck.focus();
});
ck.on('focus', function(event) {
if (attr.ckFocus) {
$parse(attr.ckFocus)($scope, {'$event': event});
}
});
}
// Update the model whenever the content changes
ck.on('change', function() {