Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Added Spree.showProgressBar
Damian Legawiec7a69622e3682
diff --git a/frontend/app/assets/javascripts/spree/frontend.js b/frontend/app/assets/javascripts/spree/frontend.jsindex d6f332c41e..513fd575c0 100644--- a/frontend/app/assets/javascripts/spree/frontend.js+++ b/frontend/app/assets/javascripts/spree/frontend.js@@ -51,3 +51,9 @@ Spree.routes.product_related = function(id) { return Spree.pathFor('products/' +Spree.routes.product_carousel = function (taxonId) { return Spree.pathFor('product_carousel/' + taxonId) }Spree.routes.set_locale = function(locale) { return Spree.pathFor('locale/set?switch_to_locale=' + locale) }Spree.routes.set_currency = function(currency) { return Spree.pathFor('currency/set?switch_to_currency=' + currency) }++Spree.showProgressBar = function () {+ if (!Turbolinks.supported) { return }+ Turbolinks.controller.adapter.progressBar.setValue(0)+ Turbolinks.controller.adapter.progressBar.show()+}diff --git a/frontend/app/assets/javascripts/spree/frontend/currency.js b/frontend/app/assets/javascripts/spree/frontend/currency.jsindex 34ca3da2f8..1da2f6bf35 100644--- a/frontend/app/assets/javascripts/spree/frontend/currency.js+++ b/frontend/app/assets/javascripts/spree/frontend/currency.js@@ -4,6 +4,7 @@ Spree.ready(function ($) {if (currencySelect.length) {currencySelect.on('change', function () {currencySelect.attr('disabled')+ Spree.showProgressBar()window.location = Spree.routes.set_currency(this.value)})}diff --git a/frontend/app/assets/javascripts/spree/frontend/locale.js b/frontend/app/assets/javascripts/spree/frontend/locale.jsindex a6dd5da8e6..951112dab8 100644--- a/frontend/app/assets/javascripts/spree/frontend/locale.js+++ b/frontend/app/assets/javascripts/spree/frontend/locale.js@@ -4,6 +4,7 @@ Spree.ready(function ($) {if (localeSelect.length) {localeSelect.on('change', function () {localeSelect.attr('disabled')+ Spree.showProgressBar()window.location = Spree.routes.set_locale(this.value)})}