'libs/jquery',
'libs/underscore',
'modules/documentCanvas/canvas/utils',
-'modules/documentCanvas/canvas/widgets',
'modules/documentCanvas/canvas/wlxmlManagers'
-], function($, _, utils, widgets, wlxmlManagers) {
+], function($, _, utils, wlxmlManagers) {
'use strict';
/* global Node:false, document:false */
return this;
},
append: function(params) {
- if(params.tag !== 'span') {
- this.data('orig-end', undefined);
- }
return manipulate(this, params, 'append');
},
prepend: function(params) {
var elementContent = this._container().contents();
var element = this;
- elementContent.each(function(idx) {
+ elementContent.each(function() {
var childElement = DocumentElement.fromHTMLElement(this, element.canvas);
if(childElement === undefined) {
return true;
}
- if(idx === 0 && elementContent.length > 1 && elementContent[1].nodeType === Node.ELEMENT_NODE && (childElement instanceof DocumentTextElement) && $.trim($(this).text()) === '') {
- return true;
- }
- if(idx > 0 && childElement instanceof DocumentTextElement) {
- if(toret[toret.length-1] instanceof DocumentNodeElement && $.trim($(this).text()) === '') {
- return true;
- }
- }
toret.push(childElement);
});
return toret;