diff --git a/umap/static/umap/js/modules/rules.js b/umap/static/umap/js/modules/rules.js index 7191d4cd..e89d6a8f 100644 --- a/umap/static/umap/js/modules/rules.js +++ b/umap/static/umap/js/modules/rules.js @@ -3,7 +3,6 @@ import * as Utils from './utils.js' import { translate } from './i18n.js' class Rule { - _condition = null get condition() { return this._condition @@ -14,7 +13,6 @@ class Rule { this.parse() } - _isDirty = false get isDirty() { return this._isDirty @@ -26,6 +24,18 @@ class Rule { } constructor(map, condition = '', options = {}) { + // TODO make this public properties when browser coverage is ok + // cf https://caniuse.com/?search=public%20class%20field + this._condition = null + this._isDirty = false + this.OPERATORS = [ + ['>', this.gt], + ['<', this.lt], + // When sent by Django + ['<', this.lt], + ['!=', this.not_equal], + ['=', this.equal], + ] this.map = map this.active = true this.options = options @@ -52,15 +62,6 @@ class Rule { return other < this.expected } - OPERATORS = [ - ['>', this.gt], - ['<', this.lt], - // When sent by Django - ['<', this.lt], - ['!=', this.not_equal], - ['=', this.equal], - ] - parse() { let vars = [] this.cast = (v) => v