3 lines
2.8 KiB
JavaScript
3 lines
2.8 KiB
JavaScript
/******/!function(e){function t(o){if(n[o])return n[o].exports;var a=n[o]={i:o,l:!1,exports:{}};return e[o].call(a.exports,a,a.exports,t),a.l=!0,a.exports}// webpackBootstrap
|
|
/******/
|
|
var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=421)}({211:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(25),a=n(257);(0,window.$)(function(){new o.a,new a.a})},25:function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=window.$,l=function(){function e(t){o(this,e),t=t||{},this.localeItemSelector=t.localeItemSelector||".js-locale-item",this.localeButtonSelector=t.localeButtonSelector||".js-locale-btn",this.localeInputSelector=t.localeInputSelector||"input.js-locale-input",r("body").on("click",this.localeItemSelector,this.toggleInputs.bind(this))}return a(e,[{key:"toggleInputs",value:function(e){var t=r(e.target),n=t.closest("form"),o=t.data("locale");n.find(this.localeButtonSelector).text(o),n.find(this.localeInputSelector).addClass("d-none"),n.find(this.localeInputSelector+".js-locale-"+o).removeClass("d-none")}}]),e}();t.a=l},257:function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=window.$,l=function(){function e(){var t=this;o(this,e),this.handle(),r('input[name="form[stock][stock_management]"]').on("change",function(){return t.handle()})}return a(e,[{key:"handle",value:function(){var e=r('input[name="form[stock][stock_management]"]:checked').val(),t=parseInt(e);this.handleAllowOrderingOutOfStockOption(t),this.handleDisplayAvailableQuantitiesOption(t)}},{key:"handleAllowOrderingOutOfStockOption",value:function(e){var t=r('input[name="form[stock][allow_ordering_oos]"]');e?t.removeAttr("disabled"):(t.val([1]),t.attr("disabled","disabled"))}},{key:"handleDisplayAvailableQuantitiesOption",value:function(e){var t=r('input[name="form[page][display_quantities]"]');e?t.removeAttr("disabled"):(t.val([0]),t.attr("disabled","disabled"))}}]),e}();t.a=l},421:function(e,t,n){e.exports=n(211)}}); |