Created
March 25, 2022 22:42
-
-
Save Kadreev/e56fc9013fcba0c7ce9beb7dee3029a3 to your computer and use it in GitHub Desktop.
GLOBAL BINDING
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
| /* | |
| * Shopify Common JS | |
| * | |
| */ | |
| if ((typeof window.Shopify) == 'undefined') { | |
| window.Shopify = {}; | |
| } | |
| Shopify.bind = function(fn, scope) { | |
| return function() { | |
| return fn.apply(scope, arguments); | |
| } | |
| }; | |
| Shopify.setSelectorByValue = function(selector, value) { | |
| for (var i = 0, count = selector.options.length; i < count; i++) { | |
| var option = selector.options[i]; | |
| if (value == option.value || value == option.innerHTML) { | |
| selector.selectedIndex = i; | |
| return i; | |
| } | |
| } | |
| }; | |
| Shopify.addListener = function(target, eventName, callback) { | |
| target.addEventListener ? target.addEventListener(eventName, callback, false) : target.attachEvent('on'+eventName, callback); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment