summaryrefslogtreecommitdiff
path: root/program/js/tiny_mce/plugins/table/editor_plugin_src.js
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-06-01 08:56:31 +0200
committerAleksander Machniak <alec@alec.pl>2012-06-01 08:56:31 +0200
commit7c3c82974e3f1ffff2dd4d71f50b53f7cdc9de96 (patch)
treeb424007315a2ae7728194a1e0b8ce9503706133e /program/js/tiny_mce/plugins/table/editor_plugin_src.js
parentfcd3f571732f62719724782b81afdcc5eca562d0 (diff)
Update to TinyMCE 3.5.2
Diffstat (limited to 'program/js/tiny_mce/plugins/table/editor_plugin_src.js')
-rw-r--r--program/js/tiny_mce/plugins/table/editor_plugin_src.js22
1 files changed, 20 insertions, 2 deletions
diff --git a/program/js/tiny_mce/plugins/table/editor_plugin_src.js b/program/js/tiny_mce/plugins/table/editor_plugin_src.js
index 832b5e943..ff095c8bf 100644
--- a/program/js/tiny_mce/plugins/table/editor_plugin_src.js
+++ b/program/js/tiny_mce/plugins/table/editor_plugin_src.js
@@ -287,6 +287,21 @@
endX = startX + (cols - 1);
endY = startY + (rows - 1);
} else {
+ startPos = endPos = null;
+
+ // Calculate start/end pos by checking for selected cells in grid works better with context menu
+ each(grid, function(row, y) {
+ each(row, function(cell, x) {
+ if (isCellSelected(cell)) {
+ if (!startPos) {
+ startPos = {x: x, y: y};
+ }
+
+ endPos = {x: x, y: y};
+ }
+ });
+ });
+
// Use selection
startX = startPos.x;
startY = startPos.y;
@@ -599,6 +614,9 @@
else
dom.insertAfter(row, targetRow);
});
+
+ // Remove current selection
+ dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected');
};
function getPos(target) {
@@ -1227,7 +1245,7 @@
for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ;
if (last && last.nodeName == 'TABLE')
- ed.dom.add(ed.getBody(), 'p', null, '<br mce_bogus="1" />');
+ ed.dom.add(ed.getBody(), 'p', null, '<br data-mce-bogus="1" />');
};
// Fixes an bug where it's impossible to place the caret before a table in Gecko
@@ -1265,7 +1283,7 @@
ed.onPreProcess.add(function(ed, o) {
var last = o.node.lastChild;
- if (last && last.childNodes.length == 1 && last.firstChild.nodeName == 'BR')
+ if (last && last.childNodes.length == 1 && last.firstChild.nodeName == 'BR' && last.previousSibling && last.previousSibling.nodeName == "TABLE")
ed.dom.remove(last);
});