Skip to content

Commit

Permalink
pr comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey Pope committed Aug 16, 2019
1 parent 04b78c0 commit a3ccd6b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/nav/page-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,11 @@
onPopoverClose() {
this.isPopoverOpen = false;
},
compareSite(site, slug) {
return site.subsiteSlug === slug || site.slug === slug;
},
selectSite(slug) {
const site = _.find(this.sites, s => s.subsiteSlug === slug || s.slug === slug);
const site = _.find(this.sites, s => this.compareSite(s, slug));
site.selected = !site.selected;
this.$store.commit('FILTER_PAGELIST_SITE', _.map(this.selectedSites, site => site.subsiteSlug || site.slug).join(', '));
Expand All @@ -303,7 +306,7 @@
setSingleSite(slug) {
// loop through all sites, making sure that only one is selected
_.each(this.sites, (site) => {
if (site.subsiteSlug === slug || site.slug === slug) {
if (this.compareSite(site, slug)) {
site.selected = true;
} else {
site.selected = false;
Expand Down

0 comments on commit a3ccd6b

Please sign in to comment.