MDL-61733 atto_table: fix creating new table
If Atto is embedded in an HTML table (e.g. in the database activity on the template pages), you could not create a new table.
This commit is contained in:
Vendored
+4
-3
@@ -317,7 +317,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
* @return {boolean} whether or not the parameter node exists within the editor.
|
||||
*/
|
||||
_stopAtContentEditableFilter: function(node) {
|
||||
this.editor.contains(node);
|
||||
return this.editor.contains(node);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -411,12 +411,13 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
_getSuitableTableCell: function() {
|
||||
var targetcell = null,
|
||||
host = this.get('host');
|
||||
var stopAtContentEditableFilter = Y.bind(this._stopAtContentEditableFilter, this);
|
||||
|
||||
host.getSelectedNodes().some(function(node) {
|
||||
if (node.ancestor('td, th, caption', true, this._stopAtContentEditableFilter)) {
|
||||
if (node.ancestor('td, th, caption', true, stopAtContentEditableFilter)) {
|
||||
targetcell = node;
|
||||
|
||||
var caption = node.ancestor('caption', true, this._stopAtContentEditableFilter);
|
||||
var caption = node.ancestor('caption', true, stopAtContentEditableFilter);
|
||||
if (caption) {
|
||||
var table = caption.get('parentNode');
|
||||
if (table) {
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+4
-3
@@ -317,7 +317,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
* @return {boolean} whether or not the parameter node exists within the editor.
|
||||
*/
|
||||
_stopAtContentEditableFilter: function(node) {
|
||||
this.editor.contains(node);
|
||||
return this.editor.contains(node);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -411,12 +411,13 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
_getSuitableTableCell: function() {
|
||||
var targetcell = null,
|
||||
host = this.get('host');
|
||||
var stopAtContentEditableFilter = Y.bind(this._stopAtContentEditableFilter, this);
|
||||
|
||||
host.getSelectedNodes().some(function(node) {
|
||||
if (node.ancestor('td, th, caption', true, this._stopAtContentEditableFilter)) {
|
||||
if (node.ancestor('td, th, caption', true, stopAtContentEditableFilter)) {
|
||||
targetcell = node;
|
||||
|
||||
var caption = node.ancestor('caption', true, this._stopAtContentEditableFilter);
|
||||
var caption = node.ancestor('caption', true, stopAtContentEditableFilter);
|
||||
if (caption) {
|
||||
var table = caption.get('parentNode');
|
||||
if (table) {
|
||||
|
||||
@@ -315,7 +315,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
* @return {boolean} whether or not the parameter node exists within the editor.
|
||||
*/
|
||||
_stopAtContentEditableFilter: function(node) {
|
||||
this.editor.contains(node);
|
||||
return this.editor.contains(node);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -409,12 +409,13 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
_getSuitableTableCell: function() {
|
||||
var targetcell = null,
|
||||
host = this.get('host');
|
||||
var stopAtContentEditableFilter = Y.bind(this._stopAtContentEditableFilter, this);
|
||||
|
||||
host.getSelectedNodes().some(function(node) {
|
||||
if (node.ancestor('td, th, caption', true, this._stopAtContentEditableFilter)) {
|
||||
if (node.ancestor('td, th, caption', true, stopAtContentEditableFilter)) {
|
||||
targetcell = node;
|
||||
|
||||
var caption = node.ancestor('caption', true, this._stopAtContentEditableFilter);
|
||||
var caption = node.ancestor('caption', true, stopAtContentEditableFilter);
|
||||
if (caption) {
|
||||
var table = caption.get('parentNode');
|
||||
if (table) {
|
||||
|
||||
Reference in New Issue
Block a user