-
- ///
-
- isSpan: function() {
- return this.wlxmlNode.getTagName() === 'span';
- },
-
- containsBlock: function() {
- return this.children()
- .filter(function(child) {
- return child instanceof documentElement.DocumentNodeElement;
- })
- .some(function(child) {
- if(child.isBlock()) {
- return true;
- } else {
- return child.containsBlock();
- }
- });
- },
-
- prepend: function(param) {
- var element;
- if(param instanceof documentElement.DocumentElement) {
- element = param;
- } else {
- element = this.canvas.createElement(param);
- }
- this._container().prepend(element.dom);
- this.refreshPath();
- return element;
- },
-
- childIndex: function(child) {
- var children = this.children(),
- toret = null;
- children.forEach(function(c, idx) {
- if(c.sameNode(child)) {
- toret = idx;
- return false;
- }
- });
- return toret;
- },
-
- getWlxmlClass: function() {
- var klass = this._container().attr('wlxml-class');
- if(klass) {
- return klass.replace(/-/g, '.');
- }
- return undefined;
- },
- setWlxmlClass: function(klass) {
- if(klass === this.getWlxmlClass()) {
- return;
- }
- if(klass) {
- this._container().attr('wlxml-class', klass.replace(/\./g, '-'));
- }
- else {
- this._container().removeAttr('wlxml-class');
- }
- this.refreshPath();
- }