edit: customise default table attributes
authorMischa POSLAWSKY <perl@shiar.org>
Fri, 11 Jul 2014 16:07:59 +0000 (18:07 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 15 Jul 2014 11:50:32 +0000 (13:50 +0200)
Prevent unwanted values for styling attributes.

edit.js

diff --git a/edit.js b/edit.js
index 37e1444c6feee3050992b6880a76e204d6838777..94e84cc19728757f11b9ba21f2db93b3884788e4 100644 (file)
--- a/edit.js
+++ b/edit.js
@@ -25,6 +25,17 @@ CKEDITOR.plugins.add('inlinesave', {
        }
 });
 
+CKEDITOR.on('dialogDefinition', function (event) {
+       if (event.data.name === 'table') {
+               // override initial attribute values
+               var infoTab = event.data.definition.getContents('info');
+               infoTab.get('txtWidth').default = '';
+               infoTab.get('txtBorder').default = '0';
+               infoTab.get('txtCellSpace').default = '';
+               infoTab.get('txtCellPad').default = '';
+       }
+});
+
 CKEDITOR.on('instanceCreated', function (event) {
        var editor = event.editor;
        editor.on('configLoaded', function () {