define([
-'libs/jquery-1.9.1.min'
-], function($) {
+'libs/jquery-1.9.1.min',
+'libs/underscore-min'
+], function($, _) {
'use strict';
},
wrapWithNodeElement: function(wlxmlNode) {
- this.$element.wrap($('<' + wlxmlNode.tag + ' class="' + wlxmlNode.klass + '"">')[0]);
+ this.$element.wrap($('<' + wlxmlNode.tag + ' class="' + wlxmlNode.klass.replace('.', '-') + '">')[0]);
return documentElementFromHTMLElement(this.$element.parent().get(0), this.canvas);
},
},
after: function(params) {
manipulate(this, params, 'after');
+ },
+ setWlxmlClass: function(klass) {
+ this.$element.attr('class', klass);
+ },
+ is: function(what) {
+ if(what === 'list' && _.contains(['list-items', 'list-items-enum'], this.$element.attr('class')))
+ return true;
+ return false;
}
});
this.$element.unwrap();
return documentElementFromHTMLElement(dom[0]);
},
+ before: function(params) {
+ if(params instanceof DocumentTextElement || params.text)
+ return false;
+ var dom;
+ if(params instanceof DocumentNodeElement) {
+ dom = params.dom();
+ } else {
+ dom = DocumentNodeElement.createDOM(params);
+ }
+ this.$element.wrap('<div>');
+ this.$element.parent().before(dom[0]);
+ this.$element.unwrap();
+ return documentElementFromHTMLElement(dom[0]);
+ },
wrapWithNodeElement: function(wlxmlNode) {
if(wlxmlNode.start && wlxmlNode.end) {
return this.canvas.wrapText({