From 2078bfa96afaef40acb4edac99848ba55e808ef1 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 3 May 2012 15:15:21 -0700 Subject: Refactor creating elements. Removed makeNJElement and separated the model creation Signed-off-by: Valerio Virgillito --- js/mediators/drag-drop-mediator.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'js/mediators') diff --git a/js/mediators/drag-drop-mediator.js b/js/mediators/drag-drop-mediator.js index b0aba5b6..59086ef6 100755 --- a/js/mediators/drag-drop-mediator.js +++ b/js/mediators/drag-drop-mediator.js @@ -114,11 +114,13 @@ exports.DragDropMediator = Montage.create(Component, { var self = this; // if (e.currentTarget.fileType.indexOf('svg') !== -1) { - element = NJUtils.makeNJElement('embed', 'SVG', 'block');//TODO: Verify this is proper + element = NJUtils.make('embed', null, this.application.ninja.currentDocument);//TODO: Verify this is proper + NJUtils.createModelWithSelection(element, "SVG"); element.type = 'image/svg+xml'; element.src = url+'/'+fileName; } else { - element = NJUtils.makeNJElement('image', 'image', 'image'); + element = NJUtils.make('image', null, this.application.ninja.currentDocument); + NJUtils.createModel(element); element.src = url+'/'+fileName; } //Adding element once it is loaded -- cgit v1.2.3