Commit 5a127917 authored by Pat Kira's avatar Pat Kira
Browse files

BUG 1465107 - Style tinymce image formatting options

Fix tinymce imagebrowser won't scroll bug

Change-Id: Ib5f626636e2eb504c85f223aed61c8e5151ab0dd
behatnotneeded: styling only
parent 9e21fc53
......@@ -26,11 +26,11 @@ tinymce.PluginManager.add('imagebrowser', function(editor) {
// page we don't as the configure form already has overlay but
// elsewhere we do.
var formname = '#imgbrowserconf',
win,
data = {},
dom = editor.dom,
win,
data = {},
dom = editor.dom,
imgElm = editor.selection.getNode();
jQuery('body').addClass('modal-open');
if (imgElm.nodeName == 'IMG' && !imgElm.getAttribute('data-mce-object') && !imgElm.getAttribute('data-mce-placeholder')) {
// existing values
data = {
......@@ -245,6 +245,7 @@ tinymce.PluginManager.add('imagebrowser', function(editor) {
function removeImageBrowser() {
setTimeout(function() {
jQuery('body').removeClass('modal-open');
jQuery('#imagebrowser div.configure').each( function() {
jQuery(this).addClass('hidden');
});
......
......@@ -114,7 +114,7 @@ class ImageBrowser {
'collapsible' => true,
'collapsed' => true,
'legend' => get_string('image'),
'class' => 'last select-file mtl',
'class' => 'select-file mtl',
'elements' => array(
'artefactid' => self::config_filebrowser_element($this, null)
)
......@@ -128,81 +128,79 @@ class ImageBrowser {
$elements['view'] = array('type' => 'hidden', 'value' => $this->view);
// tinymce specific elements
$alignoptions = array( 'none' => '--',
'top' => 'Top',
'middle' => 'Middle',
'bottom' => 'Bottom',
'left' => 'Left',
'right' => 'Right'
);
$alignoptions = array(
'none' => '--',
'top' => 'Top',
'middle' => 'Middle',
'bottom' => 'Bottom',
'left' => 'Left',
'right' => 'Right'
);
$elements['toggleformatting'] = array(
'type' => 'html',
'class' => 'toggleablecontainer',
'value' => '<div id="formattingoptionstoggle" class="retracted arrow"><label>Image formatting options</label></div>',
);
$elements ['formattingoptions'] = array (
'type' => 'container',
'name' => 'formattingoptions',
'class' => 'js-hidden',
'elements' => array (
'width' => array (
'type' => 'text',
'title' => get_string ( 'dimensions' ),
'size' => 3,
'rules' => array (
'maxlength' => 4
)
),
'height' => array (
'type' => 'text',
'size' => 3,
'rules' => array (
'maxlength' => 4
)
),
'constrain' => array (
'type' => 'switchbox',
'title' => get_string ( 'constrain' ),
'defaultvalue' => true
),
'vspace' => array (
'type' => 'text',
'title' => get_string ( 'vspace' ),
'size' => 3,
'rules' => array (
'maxlength' => 2
)
),
'hspace' => array (
'type' => 'text',
'title' => get_string ( 'hspace' ),
'size' => 3,
'rules' => array (
'maxlength' => 2
)
),
'border' => array (
'type' => 'text',
'title' => get_string ( 'border' ),
'size' => 3,
'rules' => array (
'maxlength' => 2
)
),
'align' => array (
'defaultvalue' => 'none',
'type' => 'select',
'title' => get_string ( 'alignment' ),
'options' => $alignoptions
),
'style' => array (
'type' => 'text',
'title' => get_string ( 'style' ),
'size' => 50
)
)
);
'type' => 'fieldset',
'collapsible' => true,
'collapsed' => true,
'legend' => 'Image formatting options',
'class' => 'last',
'elements' => array(
'width' => array(
'type' => 'text',
'title' => get_string ( 'width' ),
'size' => 3,
'rules' => array (
'maxlength' => 4
)
),
'height' => array(
'type' => 'text',
'title' => get_string ( 'height' ),
'size' => 3,
'rules' => array (
'maxlength' => 4
)
),
'constrain' => array (
'type' => 'switchbox',
'title' => get_string ( 'constrain' ),
'defaultvalue' => true
),
'vspace' => array (
'type' => 'text',
'title' => get_string ( 'vspace' ),
'size' => 3,
'rules' => array (
'maxlength' => 2
)
),
'hspace' => array (
'type' => 'text',
'title' => get_string ( 'hspace' ),
'size' => 3,
'rules' => array (
'maxlength' => 2
)
),
'border' => array (
'type' => 'text',
'title' => get_string ( 'border' ),
'size' => 3,
'rules' => array (
'maxlength' => 2
)
),
'align' => array (
'defaultvalue' => 'none',
'type' => 'select',
'title' => get_string ( 'alignment' ),
'options' => $alignoptions
),
'style' => array (
'type' => 'text',
'title' => get_string ( 'style' ),
'size' => 50
)
),
);
$wwwroot = get_config('wwwroot');
$goto = "";
if ($this->view) {
......
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