| 1 | /*! |
| 2 | * VisualEditor DataModel TableSlice class. |
| 3 | * |
| 4 | * @copyright See AUTHORS.txt |
| 5 | */ |
| 6 | |
| 7 | /** |
| 8 | * DataModel document slice |
| 9 | * |
| 10 | * @class |
| 11 | * @extends ve.dm.Document |
| 12 | * @constructor |
| 13 | * @param {HTMLDocument|Array|ve.dm.ElementLinearData} data |
| 14 | * @param {HTMLDocument} [htmlDocument] |
| 15 | * @param {ve.dm.Document} [parentDocument] |
| 16 | * @param {ve.dm.InternalList} [internalList] |
| 17 | * @param {ve.Range} [tableRange] Table range |
| 18 | * @param {ve.dm.Document} [originalDocument] |
| 19 | */ |
| 20 | ve.dm.TableSlice = function VeDmTableSlice( data, htmlDocument, parentDocument, internalList, tableRange, originalDocument ) { |
| 21 | // Parent constructor |
| 22 | ve.dm.TableSlice.super.call( this, data, htmlDocument, parentDocument, internalList, tableRange, tableRange, originalDocument ); |
| 23 | }; |
| 24 | |
| 25 | /* Inheritance */ |
| 26 | |
| 27 | OO.inheritClass( ve.dm.TableSlice, ve.dm.DocumentSlice ); |
| 28 | |
| 29 | /* Methods */ |
| 30 | |
| 31 | /** |
| 32 | * Get the parent table node in this document slice |
| 33 | * |
| 34 | * @return {ve.dm.TableNode} Table node |
| 35 | */ |
| 36 | ve.dm.TableSlice.prototype.getTableNode = function () { |
| 37 | if ( !this.documentNode.length ) { |
| 38 | this.rebuildTree(); |
| 39 | } |
| 40 | return this.documentNode.children[ 0 ]; |
| 41 | }; |