Created
September 6, 2019 10:10
-
-
Save fildidi/dcf21a7906fa3490511025001681336c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let flkty; | |
| paragraphs.forEach(paragraph => { | |
| const itemsToFilterContainers = [].slice.call( | |
| document.querySelector(`[data-selector^="${paragraph.getAttribute('data-selector')}"]`) | |
| .querySelectorAll('[data-selector="filterItemsContainer"]')); | |
| const tpGrid = [].slice.call(document.querySelectorAll('.tp--grid')); | |
| itemsToFilterContainers.forEach(item => { | |
| new Vue({ | |
| el: item, | |
| data: { | |
| selected_travel_themes: travelThemeDropdownOptionSelected, | |
| selected_destinations: destinationsDropdownOptionSelected, | |
| selected_destination_types: destinationTypesDropdownOptionSelected, | |
| searchString: '', | |
| destinationsDropdownOptionsMapped: [], | |
| hideList: true, | |
| hideBtn: false | |
| }, | |
| computed: { | |
| }, | |
| mounted() { | |
| this.$nextTick(this.countCardsInGridView(0)); | |
| }, | |
| methods: { | |
| countCardsInGridView(pageNumber) { | |
| if (tpGrid) { | |
| tpGrid.forEach(grid => { | |
| const cards = [].slice.call(grid.children) | |
| cards.forEach((card, index) => { | |
| if (index + 1 > 9) { | |
| card.classList.add('hide') | |
| } else { | |
| card.classList.add('show') | |
| } | |
| }); | |
| }) | |
| } | |
| }, | |
| loadMoreCards() { | |
| console.log('loadMoreCards'); | |
| } | |
| } | |
| }) | |
| }) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment