Index: trunk/extensions/VisualEditor/modules/es/bases/es.DocumentViewNode.js |
— | — | @@ -86,6 +86,19 @@ |
87 | 87 | return this.model; |
88 | 88 | }; |
89 | 89 | |
| 90 | +es.DocumentViewNode.getSplitableNode = function( node ) { |
| 91 | + var splitableNode = null; |
| 92 | + |
| 93 | + es.DocumentNode.traverseUpstream( node, function( node ) { |
| 94 | + var elementType = node.model.getElementType(); |
| 95 | + if ( splitableNode != null && es.DocumentView.splitRules[ elementType ].children === true ) { |
| 96 | + return false; |
| 97 | + } |
| 98 | + splitableNode = es.DocumentView.splitRules[ elementType ].self ? node : null |
| 99 | + } ); |
| 100 | + return splitableNode; |
| 101 | +}; |
| 102 | + |
90 | 103 | /* Inheritance */ |
91 | 104 | |
92 | 105 | es.extendClass( es.DocumentViewNode, es.DocumentNode ); |