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
| var Shopify = Shopify || {}; | |
| // --------------------------------------------------------------------------- | |
| // Money format handler | |
| // --------------------------------------------------------------------------- | |
| Shopify.money_format = "${{amount}}"; | |
| Shopify.formatMoney = function(cents, format) { | |
| if (typeof cents == 'string') { cents = cents.replace('.',''); } | |
| var value = ''; | |
| var placeholderRegex = /\{\{\s*(\w+)\s*\}\}/; | |
| var formatString = (format || this.money_format); |
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
| const element_exist = async selector => { | |
| while ( document.querySelector(selector) === null) { | |
| await new Promise( resolve => requestAnimationFrame(resolve) ) | |
| } | |
| return document.querySelector(selector); | |
| }; | |
| element_exist('#button-added-to-dom').then((selector) => { | |
| const button = document.querySelector('#button-added-to-dom'); |
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
| var address_inputs = document.getElementsByClassName('address'); | |
| for(i = 0; i < address_inputs.length; i++) { | |
| var autocomplete = new google.maps.places.Autocomplete(address_inputs[i]); | |
| autocomplete.inputId = address_inputs[i].id; | |
| google.maps.event.addListener(autocomplete, 'place_changed', function() { | |
| var address_submit = document.getElementById(this.inputId.replace('address', 'submit')); | |
| address_submit.click(); |