Skip to content

Commit

Permalink
Merge pull request #308 from ripe-tech/ms/307-no_masks_tag
Browse files Browse the repository at this point in the history
#307: Disable masks if build contains "no_masks" tag
  • Loading branch information
joamag authored Sep 6, 2021
2 parents 4c9d53a + 01ec19f commit 130a949
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

* Added `itertools.js` to gulpfile build files in order to be bundled
* Support for `no_masks` tag
* `getPrices` which consumes `/api/config/prices` for getting prices for several configs in a single batch call

### Changed
Expand Down
14 changes: 12 additions & 2 deletions src/js/visual/configurator-prc.js
Original file line number Diff line number Diff line change
Expand Up @@ -729,9 +729,14 @@ ripe.ConfiguratorPrc.prototype.highlight = function(part, options = {}) {
// nature of execution) returns the control flow immediately
if (!this.element) return;

// if the 'useMasks' options is not set and the model has the "no_masks"
// tag, then no masks are meant to be used
const useMasks =
this.useMasks !== undefined && this.owner.hasTag("no_masks") ? false : this.useMasks;

// verifiers if masks are meant to be used for the current model
// and if that's not the case returns immediately
if (!this.useMasks) return;
if (!useMasks) return;

// captures the current context to be used by clojure callbacks
const self = this;
Expand Down Expand Up @@ -804,9 +809,14 @@ ripe.ConfiguratorPrc.prototype.lowlight = function(options) {
// nature of execution) returns the control flow immediately
if (!this.element) return;

// if the 'useMasks' options is not set and the model has the "no_masks"
// tag, then no masks are meant to be used
const useMasks =
this.useMasks !== undefined && this.owner.hasTag("no_masks") ? false : this.useMasks;

// verifies if masks are meant to be used for the current model
// and if that's not the case returns immediately
if (!this.useMasks) return;
if (!useMasks) return;

// retrieves the reference to the current front mask and removes
// the highlight associated classes from it and the configurator
Expand Down

0 comments on commit 130a949

Please sign in to comment.