X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/ac50cae92710f684c801ad933b924de2bec2b460..17683274ad99fde6de3c1c6c292c125cf8bc1956:/src/editor/plugins/core/edumed/order/view.js diff --git a/src/editor/plugins/core/edumed/order/view.js b/src/editor/plugins/core/edumed/order/view.js index 8905e7a..3dc9a81 100644 --- a/src/editor/plugins/core/edumed/order/view.js +++ b/src/editor/plugins/core/edumed/order/view.js @@ -14,17 +14,9 @@ var OrderExerciseView = function(element) { this.dom = $(_.template(viewTemplate)()); this.modePills = this.dom.find('.modePills'); this.list = this.dom.find('ol'); - this.addButton = this.dom.find('button.add'); this.description = this.dom.find('.description'); this.itemViews = []; - this.addButton.on('click', function(e) { - e.stopPropagation(); - e.preventDefault(); - this.trigger('newItemRequested'); - //_.last(this.itemViews).editStart(); - }.bind(this)); - this.modePills.find('a').on('click', function(e) { e.stopPropagation(); e.preventDefault(); @@ -82,14 +74,12 @@ var OrderExerciseView = function(element) { this.trigger(this.mode === 'initial' ? 'moveItem' : 'moveAnswer', droppedItem.item, first.item, 'before'); dropTargets.removeClass('active'); + e.preventDefault(); }.bind(this)); }; _.extend(OrderExerciseView.prototype, Backbone.Events, { addItem: function(item) { var view = new ItemView(item, this); - view.on('edit', function(text) { - this.trigger('itemEdited', item, text); - }.bind(this)); view.on('receivedDrop', function(droppedItem) { this.trigger(this.mode === 'initial' ? 'moveItem' : 'moveAnswer', droppedItem.item, item, 'after'); }.bind(this)); @@ -150,7 +140,7 @@ var ItemView = function(item, exerciseView) { var dropTargets = this.dom.find('.placeholder'), - dragSources = this.dom.find('.wrapper'); + dragSources = this.dom.find('.handle'); dragSources.on('dragstart', function(e) { this.dom.addClass('dragged');