MDL-50801 atto_table: Caption node might not be present

Users may not use atto table (which always adds a caption) to set
HTML tables, this patch addresses that case.
This commit is contained in:
David Monllao
2015-08-20 15:25:44 +08:00
parent 85fa6a9305
commit bcd58d9ff7
4 changed files with 4 additions and 4 deletions
@@ -929,7 +929,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
captioninput.set('value', '');
}
if (captionpositioninput && captionnode.getAttribute('style')) {
if (captionpositioninput && captionnode && captionnode.getAttribute('style')) {
captionpositioninput.set('value', captionnode.getStyle('caption-side'));
} else {
// Default to none.
File diff suppressed because one or more lines are too long
@@ -929,7 +929,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
captioninput.set('value', '');
}
if (captionpositioninput && captionnode.getAttribute('style')) {
if (captionpositioninput && captionnode && captionnode.getAttribute('style')) {
captionpositioninput.set('value', captionnode.getStyle('caption-side'));
} else {
// Default to none.
+1 -1
View File
@@ -927,7 +927,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
captioninput.set('value', '');
}
if (captionpositioninput && captionnode.getAttribute('style')) {
if (captionpositioninput && captionnode && captionnode.getAttribute('style')) {
captionpositioninput.set('value', captionnode.getStyle('caption-side'));
} else {
// Default to none.