Merge branch 'MDL-50304_28' of https://github.com/jinhofer/moodle into MOODLE_28_STABLE

This commit is contained in:
Dan Poltawski
2015-06-01 13:21:57 +01:00
4 changed files with 26 additions and 17 deletions
@@ -949,13 +949,11 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
* @private
*/
_addRowAfter: function() {
var rowindex = this._getRowIndex(this._lastTarget);
var tablebody = this._lastTarget.ancestor('table').one('tbody');
var target = this._lastTarget.ancestor('tr'),
tablebody = this._lastTarget.ancestor('table').one('tbody');
if (!tablebody) {
// Not all tables have tbody.
tablebody = this._lastTarget.ancestor('table');
rowindex += 1;
}
var firstrow = tablebody.one('tr');
@@ -978,7 +976,12 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
tablecell.setHTML(' ');
});
tablebody.insert(newrow, rowindex);
if (target.ancestor('thead')) {
target = firstrow;
tablebody.insert(newrow, target);
} else {
target.insert(newrow, 'after');
}
// Clean the HTML.
this.markUpdated();
File diff suppressed because one or more lines are too long
@@ -949,13 +949,11 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
* @private
*/
_addRowAfter: function() {
var rowindex = this._getRowIndex(this._lastTarget);
var tablebody = this._lastTarget.ancestor('table').one('tbody');
var target = this._lastTarget.ancestor('tr'),
tablebody = this._lastTarget.ancestor('table').one('tbody');
if (!tablebody) {
// Not all tables have tbody.
tablebody = this._lastTarget.ancestor('table');
rowindex += 1;
}
var firstrow = tablebody.one('tr');
@@ -978,7 +976,12 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
tablecell.setHTML(' ');
});
tablebody.insert(newrow, rowindex);
if (target.ancestor('thead')) {
target = firstrow;
tablebody.insert(newrow, target);
} else {
target.insert(newrow, 'after');
}
// Clean the HTML.
this.markUpdated();
+8 -5
View File
@@ -947,13 +947,11 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
* @private
*/
_addRowAfter: function() {
var rowindex = this._getRowIndex(this._lastTarget);
var tablebody = this._lastTarget.ancestor('table').one('tbody');
var target = this._lastTarget.ancestor('tr'),
tablebody = this._lastTarget.ancestor('table').one('tbody');
if (!tablebody) {
// Not all tables have tbody.
tablebody = this._lastTarget.ancestor('table');
rowindex += 1;
}
var firstrow = tablebody.one('tr');
@@ -976,7 +974,12 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
tablecell.setHTML(' ');
});
tablebody.insert(newrow, rowindex);
if (target.ancestor('thead')) {
target = firstrow;
tablebody.insert(newrow, target);
} else {
target.insert(newrow, 'after');
}
// Clean the HTML.
this.markUpdated();