mirror of
https://github.com/moodle/moodle.git
synced 2025-03-24 09:30:17 +01:00
MDL-44810 editor_atto: restore selection after button press
Fixed issue where clicking on buttons erroneously lost viewport focus and selection.
This commit is contained in:
parent
1a727e121e
commit
0a1456dfa8
@ -95,6 +95,11 @@ Y.extend(EditorPlugin, Y.Base, {
|
||||
* @method markUpdated
|
||||
*/
|
||||
markUpdated: function() {
|
||||
// Save selection after changes to the DOM. If you don't do this here,
|
||||
// subsequent calls to restoreSelection() will fail expecting the
|
||||
// previous DOM state.
|
||||
this.get('host').saveSelection();
|
||||
|
||||
return this.get('host').updateOriginal();
|
||||
}
|
||||
}, {
|
||||
@ -760,6 +765,9 @@ EditorPluginButtons.prototype = {
|
||||
// Build the arguments list, but remove the callback we're calling.
|
||||
var args = [e, callbackArgs];
|
||||
|
||||
// Restore selection before making changes.
|
||||
this.get('host').restoreSelection();
|
||||
|
||||
// Actually call the callback now.
|
||||
return callback.apply(this, args);
|
||||
},
|
||||
|
File diff suppressed because one or more lines are too long
@ -95,6 +95,11 @@ Y.extend(EditorPlugin, Y.Base, {
|
||||
* @method markUpdated
|
||||
*/
|
||||
markUpdated: function() {
|
||||
// Save selection after changes to the DOM. If you don't do this here,
|
||||
// subsequent calls to restoreSelection() will fail expecting the
|
||||
// previous DOM state.
|
||||
this.get('host').saveSelection();
|
||||
|
||||
return this.get('host').updateOriginal();
|
||||
}
|
||||
}, {
|
||||
@ -758,6 +763,9 @@ EditorPluginButtons.prototype = {
|
||||
// Build the arguments list, but remove the callback we're calling.
|
||||
var args = [e, callbackArgs];
|
||||
|
||||
// Restore selection before making changes.
|
||||
this.get('host').restoreSelection();
|
||||
|
||||
// Actually call the callback now.
|
||||
return callback.apply(this, args);
|
||||
},
|
||||
|
@ -618,6 +618,9 @@ EditorPluginButtons.prototype = {
|
||||
// Build the arguments list, but remove the callback we're calling.
|
||||
var args = [e, callbackArgs];
|
||||
|
||||
// Restore selection before making changes.
|
||||
this.get('host').restoreSelection();
|
||||
|
||||
// Actually call the callback now.
|
||||
return callback.apply(this, args);
|
||||
},
|
||||
|
@ -93,6 +93,11 @@ Y.extend(EditorPlugin, Y.Base, {
|
||||
* @method markUpdated
|
||||
*/
|
||||
markUpdated: function() {
|
||||
// Save selection after changes to the DOM. If you don't do this here,
|
||||
// subsequent calls to restoreSelection() will fail expecting the
|
||||
// previous DOM state.
|
||||
this.get('host').saveSelection();
|
||||
|
||||
return this.get('host').updateOriginal();
|
||||
}
|
||||
}, {
|
||||
|
Loading…
x
Reference in New Issue
Block a user