This is an automated email from the git hooks/post-receive script. New commit to branch feature/6393 in repository wao. See http://git.codelutin.com/wao.git commit a53a89184f40c164cea6116c6067b1f60d7d6ced Author: Brendan Le Ny <bleny@codelutin.com> Date: Wed Jan 21 11:59:18 2015 +0100 prototype pour un bouton pour tout sélectionner dans un filtre --- wao-web/src/main/webapp/wao.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/wao-web/src/main/webapp/wao.js b/wao-web/src/main/webapp/wao.js index f2ec750..539d402 100644 --- a/wao-web/src/main/webapp/wao.js +++ b/wao-web/src/main/webapp/wao.js @@ -360,6 +360,11 @@ var OneFilterModel = function (filterMapping, filterModel) { $(self).trigger('selected-options-updated', [ self ]); }; + this.selectAll = function () { + var allOptions = this.options.slice(0); // copy + this.setSelectedOptions(allOptions); + }; + this.onFilterUpdated = function (filter) { var selectedOptions = []; var filterValues = WAO.getNestedPropertyValue(this.filterMapping.filterName, filter); @@ -407,6 +412,9 @@ var OneFilterView = function (oneFilterModel) { + ' <button type="button" class="btn btn-link close-button">' + ' <i class="fa fa-check"></i>' + ' </button>' + + ' <button type="button" class="btn btn-link select-all-button">' + + ' <i class="fa fa-anchor"></i>' + + ' </button>' + ' </span>' + ' </div>' + '</div>' @@ -421,6 +429,7 @@ var OneFilterView = function (oneFilterModel) { this.$openButton = this.$container.find('button.open-button'); this.$closeButton = this.$container.find('button.close-button'); + this.$selectAllButton = this.$container.find('button.select-all-button'); this.updateSelectedOptions(); @@ -541,6 +550,10 @@ var OneFilterController = function (filterMapping, filterModel, filterController self.model.setSelectedOptions(selectedOptions); }); + this.view.$selectAllButton.click(function () { + self.selectAll(); + }); + this.view.$closeButton.click(function () { self.close(); }); @@ -563,6 +576,10 @@ var OneFilterController = function (filterMapping, filterModel, filterController this.view.hide(); } + this.selectAll = function () { + this.model.selectAll(); + } + }; -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.