MDL-51956 atto_table: fix bg colour bug
authorRyan Wyllie <ryan@moodle.com>
Thu, 29 Oct 2015 02:32:01 +0000 (02:32 +0000)
committerRyan Wyllie <ryan@moodle.com>
Thu, 29 Oct 2015 02:51:06 +0000 (02:51 +0000)
The table editor will now set the backgorund colour on the
table in Firefox version 34 and below.

Also expanded the dialogue slightly because the colour choices
were wrapping and I added some styling to put a gap in for the
metric markers for border width and table width.

lib/editor/atto/plugins/table/styles.css
lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button-debug.js
lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button-min.js
lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button.js
lib/editor/atto/plugins/table/yui/src/button/js/button.js

index dbdcb5b..5d2c7f6 100644 (file)
@@ -34,3 +34,6 @@ div.availablecolors label input[type="radio"] {
     margin-left: -15px;
 }
 
+input[name="bordersize"], input[name="width"] {
+    margin-right: 0.3em;
+}
index d5e3bba..e56ea66 100644 (file)
Binary files a/lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button-debug.js and b/lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button-debug.js differ
index a6b446a..7992b5d 100644 (file)
Binary files a/lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button-min.js and b/lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button-min.js differ
index d5e3bba..e56ea66 100644 (file)
Binary files a/lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button.js and b/lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button.js differ
index 679fa4b..b344c7a 100644 (file)
@@ -37,7 +37,7 @@ var COMPONENT = 'atto_table',
         BORDERWIDTH: '1'
     },
     DIALOGUE = {
-        WIDTH: '450px'
+        WIDTH: '480px'
     },
     TEMPLATE = '' +
         '<form class="{{CSS.FORM}}">' +
@@ -160,7 +160,7 @@ var COMPONENT = 'atto_table',
                 '{{#if allowWidth}}' +
                     '<label for="{{elementid}}_atto_table_width" class="sameline">' +
                     '{{get_string "width" component}}</label>' +
-                    '<input id="{{elementid}}_atto_table_width" class="{{CSS.WIDTH}}" size="8" type="number" min="0" max="100"/>' +
+                    '<input name="width" id="{{elementid}}_atto_table_width" class="{{CSS.WIDTH}}" size="8" type="number" min="0" max="100"/>' +
                     '<label style="display: inline-block;">{{CSS.WIDTHUNIT}}</label>' +
                     '<br>' +
                 '{{/if}}' +
@@ -1174,7 +1174,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
         }
 
         if (backgroundcolourvalue !== 'none') {
-            tableNode.setStyle('background-color', backgroundcolourvalue);
+            tableNode.setStyle('backgroundColor', backgroundcolourvalue);
         }
 
         if (configuration.width && configuration.width.get('value')) {
@@ -1229,8 +1229,8 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
             captionpositioninput.set('value', '');
         }
 
-        if (table.getStyle('background-color') && this.get('allowBackgroundColour')) {
-            hexColour = Y.Color.toHex(table.getStyle('background-color'));
+        if (table.getStyle('backgroundColor') && this.get('allowBackgroundColour')) {
+            hexColour = Y.Color.toHex(table.getStyle('backgroundColor'));
             matchedInput = backgroundcolours.filter('[value="' + hexColour + '"]');
 
             if (matchedInput) {