mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
MDL-14741: make tinymce toggle editor icon work as it should
This commit is contained in:
parent
b6943d3731
commit
a33fa3ad83
@ -197,10 +197,7 @@ echo <<<EOF
|
||||
});
|
||||
function toggleEditor(id) {
|
||||
var elm = document.getElementById(id);
|
||||
if (tinyMCE.getInstanceById(id) == null)
|
||||
tinyMCE.execCommand('mceAddControl', false, id);
|
||||
else
|
||||
tinyMCE.execCommand('mceRemoveControl', false, id);
|
||||
tinyMCE.execCommand('mceToggleEditor',false,elm);
|
||||
}
|
||||
function moodlefilemanager(field_name, url, type, win) {
|
||||
tinyMCE.activeEditor.windowManager.open({
|
||||
|
@ -4846,14 +4846,16 @@ function print_textarea($usehtmleditor, $rows, $cols, $width, $height, $name, $v
|
||||
$str .= '</textarea>'."\n";
|
||||
|
||||
if ($usehtmleditor) {
|
||||
$str_toggle = '<span class="helplink"><a href="javascript:toggleEditor(\''. $id .'\');"><img width="50" height="17" src="'. $CFG->httpswwwroot .'/lib/editor/tinymce/images/toggle.gif" alt="'. get_string('editortoggle') .'" title="'. get_string('editortoggle') .'" class="icontoggle" /></a></span>';
|
||||
// Show shortcuts button if HTML editor is in use, but only if JavaScript is enabled (MDL-9556)
|
||||
$str .= '';
|
||||
$str .= '<a href="javascript:toggleEditor(\''. $id .'\');"><img width="50" height="17" src="'. $CFG->httpswwwroot .'/lib/editor/tinymce/images/toggle.gif" alt="'. get_string('editortoggle') .'" title="'. get_string('editortoggle') .'" /></a>';
|
||||
$str .= '<div class="textareaicons">';
|
||||
$str .= '<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
document.write(\''.addslashes_js($str_toggle).'\');
|
||||
document.write(\''.addslashes_js(editorshortcutshelpbutton()).'\');
|
||||
//]]>
|
||||
</script>';
|
||||
$str .= '</div>';
|
||||
}
|
||||
|
||||
if ($return) {
|
||||
|
@ -489,6 +489,13 @@ img.iconkbhelp {
|
||||
border:0px;
|
||||
}
|
||||
|
||||
img.icontoggle {
|
||||
width:50px;
|
||||
height:17px;
|
||||
border:0px;
|
||||
vertical-align:middle;
|
||||
}
|
||||
|
||||
/*Accessibility: text 'seen' by screen readers but not visual users. Fixed for RTL languages, example Farsi. */
|
||||
.accesshide {
|
||||
position:absolute;
|
||||
|
Loading…
x
Reference in New Issue
Block a user