Skip to content

Commit

Permalink
Update Plugin.js
Browse files Browse the repository at this point in the history
Added support for vertical align
  • Loading branch information
mjrpes committed Feb 13, 2014
1 parent 62d3fd6 commit bb8ea50
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion js/tinymce/plugins/table/classes/Plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ define("tinymce/tableplugin/Plugin", [
editor.formatter.remove('align' + name, {}, elm);
});
}

function unApplyVAlign(elm) {
each('top middle bottom'.split(' '), function(name) {
editor.formatter.remove('valign' + name, {}, elm);
});
}

function tableDialog() {
var dom = editor.dom, tableElm, data;
Expand Down Expand Up @@ -231,7 +237,7 @@ define("tinymce/tableplugin/Plugin", [
]
},
{
label: 'Alignment',
label: 'H Align',
name: 'align',
type: 'listbox',
text: 'None',
Expand All @@ -243,6 +249,20 @@ define("tinymce/tableplugin/Plugin", [
{text: 'Center', value: 'center'},
{text: 'Right', value: 'right'}
]
},
{
label: 'V Align',
name: 'valign',
type: 'listbox',
text: 'None',
minWidth: 90,
maxWidth: null,
values: [
{text: 'None', value: ''},
{text: 'Top', value: 'top'},
{text: 'Middle', value: 'middle'},
{text: 'Bottom', value: 'bottom'}
]
}
]
},
Expand All @@ -269,6 +289,13 @@ define("tinymce/tableplugin/Plugin", [
if (data.align) {
editor.formatter.apply('align' + data.align, {}, cellElm);
}

// Apply/remove vertical alignment
unApplyVAlign(cellElm);
if (data.valign) {
editor.formatter.apply('valign' + data.valign, {}, cellElm);
}

});

editor.focus();
Expand Down

0 comments on commit bb8ea50

Please sign in to comment.