Skip to content

Commit

Permalink
parkstay.frontend.exploreparks: number casting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Percival authored and brendanc-dpaw committed Mar 21, 2018
1 parent 8e36b47 commit 8686a4a
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 4 deletions.
2 changes: 1 addition & 1 deletion parkstay/frontend/exploreparks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"jqueryui": "^1.11.1",
"moment": "^2.21.0",
"openlayers": "^4.6.4",
"vue": "^2.5.13",
"vue": "^2.3.3",
"vue-paginate": "^3.5.1"
},
"devDependencies": {
Expand Down
6 changes: 5 additions & 1 deletion parkstay/frontend/exploreparks/src/parkfinder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,11 @@ export default {
numPeople: {
cache: false,
get: function() {
var count = this.numAdults + this.numConcessions + this.numChildren + this.numInfants;
// annoying wrapper to deal with vue.js' weak number casting
var count = (this.numAdults ? this.numAdults : 0) +
(this.numConcessions ? this.numConcessions : 0) +
(this.numChildren ? this.numChildren : 0) +
(this.numInfants ? this.numInfants : 0);
if (count === 1) {
return `${count} person ▼`;
} else {
Expand Down
2 changes: 1 addition & 1 deletion parkstay/static/exploreparks/js/map.js

Large diffs are not rendered by default.

58 changes: 57 additions & 1 deletion parkstay/static/exploreparks/js/vendor.js

Large diffs are not rendered by default.

0 comments on commit 8686a4a

Please sign in to comment.