editor: cleanup - removing unused code in edumed exercises implementation
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 18 Aug 2014 08:52:20 +0000 (10:52 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 18 Aug 2014 08:52:20 +0000 (10:52 +0200)
src/editor/plugins/core/edumed/choice/list.js
src/editor/plugins/core/edumed/order/view.js

index 9174710..ed897c0 100644 (file)
@@ -15,7 +15,6 @@ var ListView = function(element, listNode, params) {
     this.params = params;
     this.dom = $(_.template(viewTemplate)());
     this.list = this.dom.find('ul');
     this.params = params;
     this.dom = $(_.template(viewTemplate)());
     this.list = this.dom.find('ul');
-    this.addButton = this.dom.find('button.add');
     this.itemViews = [];
 
     this.listNode.contents()
     this.itemViews = [];
 
     this.listNode.contents()
index a90ded4..3dc9a81 100644 (file)
@@ -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.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.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();
     this.modePills.find('a').on('click', function(e) {
         e.stopPropagation();
         e.preventDefault();
@@ -88,9 +80,6 @@ var OrderExerciseView = function(element) {
 _.extend(OrderExerciseView.prototype, Backbone.Events, {
     addItem: function(item) {
         var view = new ItemView(item, 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));
         view.on('receivedDrop', function(droppedItem) {
             this.trigger(this.mode === 'initial' ? 'moveItem' : 'moveAnswer', droppedItem.item, item, 'after');
         }.bind(this));