diff --git a/frontend/js/views/list-annotation.js b/frontend/js/views/list-annotation.js index bf6da466e..76835ce41 100644 --- a/frontend/js/views/list-annotation.js +++ b/frontend/js/views/list-annotation.js @@ -96,24 +96,6 @@ define(["jquery", throw "The annotations have to be given to the annotate view."; } - // Bind function to the good context - _.bindAll(this, "render", - "deleteFull", - "onSelect", - "saveStart", - "saveEnd", - "saveFreeText", - "saveScaling", - "toggleEditState", - "toggleCollapsedState", - "toggleExpandedState", - "toggleCommentsState", - "setCurrentTimeAsStart", - "setCurrentTimeAsEnd", - "setState", - "getState", - "handleEsc"); - this.model = attr.annotation; this.id = this.model.get("id"); @@ -408,7 +390,7 @@ define(["jquery", if (modelJSON.hasScale && this.scale) { scaleValues = this.scaleValues.toJSON(); - selectedScaleValue = _.where(scaleValues, {id: modelJSON.scale_value_id}); + selectedScaleValue = _.where(scaleValues, { id: modelJSON.scale_value_id }); if (selectedScaleValue.length > 0) { selectedScaleValue[0].isSelected = true; diff --git a/frontend/js/views/list.js b/frontend/js/views/list.js index 7764c19d7..afd23e1f0 100644 --- a/frontend/js/views/list.js +++ b/frontend/js/views/list.js @@ -83,8 +83,8 @@ define(["jquery", * @type {object} */ events: { - "click .collapse-all" : "collapseAll", - "click .expand-all" : "expandAll" + "click .collapse-all": "collapseAll", + "click .expand-all": "expandAll" }, /** @@ -104,9 +104,7 @@ define(["jquery", "getViewFromAnnotation", "insertView", "select", - "expandAll", "renderSelect", - "collapseAll", "updateView", "potentiallyOpenCurrentItems"); @@ -176,7 +174,7 @@ define(["jquery", addAnnotation: function (annotation, track, isPartofList) { var view; - // Wait that the id has be set to the model before to add it + // Wait that the id has been set on the model before to add it if (_.isUndefined(annotation.get("id"))) { annotation.once("ready", function () { this.addAnnotation(annotation, track, isPartofList); @@ -375,9 +373,7 @@ define(["jquery", * @alias module:views-list.List#expandAll */ expandAll: function (event) { - _.each(this.annotationViews, function (annView) { - annView.toggleExpandedState(event, true); - }); + _.invoke(this.annotationViews, "expand"); }, /** @@ -385,9 +381,7 @@ define(["jquery", * @alias module:views-list.List#collapseAll */ collapseAll: function (event) { - _.each(this.annotationViews, function (annView) { - annView.toggleCollapsedState(event, true); - }); + _.invoke(this.annotationViews, "collapse"); }, /** diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 8fe9c1ef8..4ea57bed0 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1819,9 +1819,8 @@ } }, "grunt-cli": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.3.2.tgz", - "integrity": "sha512-8OHDiZZkcptxVXtMfDxJvmN7MVJNE8L/yIcPb4HB7TlyFD1kDvjHrb62uhySsU14wJx9ORMnTuhRMQ40lH/orQ==", + "version": "github:gruntjs/grunt-cli#3254a1f36eb70d3cb106441c79ef4a16951e3011", + "from": "github:gruntjs/grunt-cli", "dev": true, "requires": { "grunt-known-options": "~1.1.0", diff --git a/frontend/package.json b/frontend/package.json index ee878d2a0..abf87024c 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -12,7 +12,7 @@ }, "devDependencies": { "grunt": "^1.0.3", - "grunt-cli": "^1.3.1", + "grunt-cli": "gruntjs/grunt-cli", "grunt-concurrent": "^2.3.1", "grunt-contrib-connect": "^1.0.2", "grunt-contrib-copy": "^1.0.0",