瀏覽代碼

Removed cell content aligment options from table editor context menu.

Moritz Pfeiffer 8 年之前
父節點
當前提交
6c9d202057

+ 1 - 0
CHANGELOG.txt

@@ -11,6 +11,7 @@ Changelog
  * `FieldRowPanel` now creates equal-width columns automatically if `col*` classnames are not specified (Chris Rogers)
  * Form builder now validates against multiple fields with the same name (Richard McMillan)
  * Fix: Email templates and document uploader now support custom `STATICFILES_STORAGE` (Jonny Scholes)
+ * Fix: Removed alignment options (deprecated in HTML and not rendered by Wagtail) from `TableBlock` context menu (Moritz Pfeiffer)
 
 
 1.5.2 (08.06.2016)

+ 1 - 0
docs/releases/1.6.rst

@@ -26,6 +26,7 @@ Bug fixes
 ~~~~~~~~~
 
  * Email templates and document uploader now support custom `STATICFILES_STORAGE` (Jonny Scholes)
+ * Removed alignment options (deprecated in HTML and not rendered by Wagtail) from `TableBlock` context menu (Moritz Pfeiffer)
 
 
 Upgrade considerations

+ 14 - 1
wagtail/contrib/table_block/static/table_block/js/table.js

@@ -35,7 +35,7 @@ function initTable(id, tableOptions) {
         var parentDiv = $('.widget-table_input').parent();
         parentDiv.find('.field-content').width(width);
         parentDiv.find('.fieldname-table .field-content .field-content').width('80%');
-    };
+    }
 
     try {
         dataForForm = $.parseJSON(hiddenStreamInput.val());
@@ -108,6 +108,19 @@ function initTable(id, tableOptions) {
     finalOptions.afterCreateRow = structureEvent;
     finalOptions.afterRemoveCol = structureEvent;
     finalOptions.afterRemoveRow = structureEvent;
+    finalOptions.contextMenu = [
+        'row_above',
+        'row_below',
+        '---------',
+        'col_left',
+        'col_right',
+        '---------',
+        'remove_row',
+        'remove_col',
+        '---------',
+        'undo',
+        'redo'
+    ];
     hot = new Handsontable(document.getElementById(containerId), finalOptions);
     hot.render(); // Call to render removes 'null' literals from empty cells
 

+ 0 - 1
wagtail/contrib/table_block/templates/table_block/widgets/table.html

@@ -21,4 +21,3 @@
 <br/>
 <div id="{{ attrs.id }}-handsontable-container"></div>
 {{ original_field_html }}
-