Skip to content

Instantly share code, notes, and snippets.

@iCodeForBananas
Created December 2, 2016 19:27
Show Gist options
  • Save iCodeForBananas/627e0e22c8672729263236f39c2b2c03 to your computer and use it in GitHub Desktop.
Save iCodeForBananas/627e0e22c8672729263236f39c2b2c03 to your computer and use it in GitHub Desktop.
// scripts.js
const SearchToggleButton = function() {
this.searchInputContainer = document.getElementById('search-input-container')
this.browsePartsContainer = document.getElementById('browse-parts-container')
this.handleClick = function() {
this.searchInputContainer.style.display = 'block'
this.browsePartsContainer.style.display = 'none'
}
document.getElementById('search-toggle-button').innerHTML = '<button onClick="SearchToggleButton.handleClick()" />'
}
SearchToggleButton()
const BrowsePartsToggleButton = function() {
this.searchInputContainer = document.getElementById('search-input-container')
this.browsePartsContainer = document.getElementById('browse-parts-container')
this.handleClick = function() {
this.searchInputContainer.style.display = 'none'
this.browsePartsContainer.style.display = 'block'
}
document.getElementById('browse-parts-toggle-button').innerHTML = '<button onClick="BrowsePartsToggleButton.handleClick()" />'
}
BrowsePartsToggleButton()
// header.blade.php
// <div id="search-input-container"></div>
// <div id="browse-parts-container"></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment