mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-45427 mod_data: Inserting tags into templates.
Allows tags to be inserted into the editor without having to touch Atto at all.
This commit is contained in:
parent
2c952b2f38
commit
43c762ef10
@ -6,9 +6,13 @@ function insert_field_tags(selectlist) {
|
||||
var value = selectlist.options[selectlist.selectedIndex].value;
|
||||
var editorname = 'template';
|
||||
if (typeof tinyMCE == 'undefined') {
|
||||
var element = document.getElementsByName(editorname)[0];
|
||||
// For inserting when in normal textareas
|
||||
insertAtCursor(element, value);
|
||||
if (document.execCommand('insertText')) {
|
||||
document.execCommand('insertText', false, value);
|
||||
} else {
|
||||
var element = document.getElementsByName(editorname)[0];
|
||||
// For inserting when in normal textareas
|
||||
insertAtCursor(element, value);
|
||||
}
|
||||
} else {
|
||||
tinyMCE.execInstanceCommand(editorname, 'mceInsertContent', false, value);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user