From 598c22a285b16e83749fa0de222bcd5f635335ec Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Mon, 3 Dec 2018 17:31:50 +0100 Subject: [PATCH] =?UTF-8?q?:checkered=5Fflag:=20N=C2=B01815=20fix=20tagset?= =?UTF-8?q?=20widget=20parse=20error=20in=20MSIE=20all=20versions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/jquery.itop-set-widget.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/js/jquery.itop-set-widget.js b/js/jquery.itop-set-widget.js index 145cf3fec..fe7d040c4 100644 --- a/js/jquery.itop-set-widget.js +++ b/js/jquery.itop-set-widget.js @@ -321,7 +321,23 @@ $.widget('itop.set_widget', }, _partialCodeRemove: function (setItemCode) { - this.partialValues = this.partialValues.filter(item => (item !== setItemCode)); + this.partialValues = this.partialValues.filter(this._filterArrayOnItem, setItemCode); + }, + + /** + * Used in _partialCodeRemove, as arrow functions can't be used in MSIE :( + * + * Must provide the value to filter on as the filter thisArg parameter + * see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/filter + * + * @param element + * @param index + * @param array + * @returns {boolean} + * @private + */ + _filterArrayOnItem: function (element, index, array) { + return (item !== this); }, _isCodeInPartialValues: function (setItemCode) {