summaryrefslogtreecommitdiff
path: root/program/js/tiny_mce/plugins/table/js/merge_cells.js
diff options
context:
space:
mode:
Diffstat (limited to 'program/js/tiny_mce/plugins/table/js/merge_cells.js')
-rw-r--r--program/js/tiny_mce/plugins/table/js/merge_cells.js38
1 files changed, 18 insertions, 20 deletions
diff --git a/program/js/tiny_mce/plugins/table/js/merge_cells.js b/program/js/tiny_mce/plugins/table/js/merge_cells.js
index 31d6df0ab..7ee4bf040 100644
--- a/program/js/tiny_mce/plugins/table/js/merge_cells.js
+++ b/program/js/tiny_mce/plugins/table/js/merge_cells.js
@@ -1,29 +1,27 @@
tinyMCEPopup.requireLangPack();
-function init() {
- var f = document.forms[0], v;
+var MergeCellsDialog = {
+ init : function() {
+ var f = document.forms[0];
- tinyMCEPopup.resizeToInnerSize();
+ f.numcols.value = tinyMCEPopup.getWindowArg('cols', 1);
+ f.numrows.value = tinyMCEPopup.getWindowArg('rows', 1);
+ },
- f.numcols.value = tinyMCEPopup.getWindowArg('numcols', 1);
- f.numrows.value = tinyMCEPopup.getWindowArg('numrows', 1);
-}
+ merge : function() {
+ var func, f = document.forms[0];
-function mergeCells() {
- var args = [], f = document.forms[0];
+ tinyMCEPopup.restoreSelection();
- tinyMCEPopup.restoreSelection();
+ func = tinyMCEPopup.getWindowArg('onaction');
- if (!AutoValidator.validate(f)) {
- tinyMCEPopup.alert(tinyMCEPopup.getLang('invalid_data'));
- return false;
- }
-
- args["numcols"] = f.numcols.value;
- args["numrows"] = f.numrows.value;
+ func({
+ cols : f.numcols.value,
+ rows : f.numrows.value
+ });
- tinyMCEPopup.execCommand("mceTableMergeCells", false, args);
- tinyMCEPopup.close();
-}
+ tinyMCEPopup.close();
+ }
+};
-tinyMCEPopup.onInit.add(init);
+tinyMCEPopup.onInit.add(MergeCellsDialog.init, MergeCellsDialog);