X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/ecf3b34e969acfeeb5d09b7287b233ce4bffed83..c601e8aff30efc0b4fd69765d5671e3ee88c4bf4:/modules/documentCanvas/canvas/documentElement.js diff --git a/modules/documentCanvas/canvas/documentElement.js b/modules/documentCanvas/canvas/documentElement.js index 749a2ef..9768236 100644 --- a/modules/documentCanvas/canvas/documentElement.js +++ b/modules/documentCanvas/canvas/documentElement.js @@ -165,7 +165,7 @@ var manipulate = function(e, params, action) { } else { element = DocumentElement.create(params); } - var target = action === 'append' ? e._container() : e.dom(); + var target = (action === 'append' || action === 'prepend') ? e._container() : e.dom(); target[action](element.dom()); return element; }; @@ -257,6 +257,9 @@ $.extend(DocumentNodeElement.prototype, { this.data('orig-end', undefined); return manipulate(this, params, 'append'); }, + prepend: function(params) { + return manipulate(this, params, 'prepend'); + }, before: function(params) { return manipulate(this, params, 'before');