spree_frontend 4.1.0 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5317d2a7a6ca3ca3bfb57ecec0acf3855ac522773bff72c884ee245475c5fda7
4
- data.tar.gz: 5b18212fba5963c66c4ef309335f5627506c384fde5ac8f50f84130f1bfdecc1
3
+ metadata.gz: 66009bd783576beb6c4a4536bb0b4398b1a41842c193382858000b665073d193
4
+ data.tar.gz: 93fd6bf61fc0e457e41f3904c2e284be0c85b403887b58f93d9b5ac0f1ec61b3
5
5
  SHA512:
6
- metadata.gz: 581b2b7605797cbd41255ae3a7c6039599bfb927ca626081fc90db6ed763a70bc2be1f6e2f8b8f32199f37cdbf165dcea7cb4950ab17efe52c68d2a46782e409
7
- data.tar.gz: 4cdc7a0dd326ff60029ea95993a213efd34ff292f01e1a2e5ff497f7d968ee61fde81e784d2993a8a86a97c77015e2e2088d7a2ef9275a0b1d9671019f5bc416
6
+ metadata.gz: 8d2ddf2d9958332be7bb3fd40dbc8a2c649176090a636bfba1f9109e3b00788c47b2c0e32f41f404c3c418a75cd14781f69290f10b3333126a9be9d324d9d3a1
7
+ data.tar.gz: ef2b78d65c6756d35f5d88783d130d8b950853fc07d24bfdd6a4de2a7d14907269026aafb59fadeb5947ea345f625a16641f05cfd35a2e1bbb445ab6a114e6a1
@@ -220,7 +220,7 @@ function CartForm($, $cartForm) {
220
220
 
221
221
  if (!variant) return
222
222
 
223
- this.$price.text(variant.display_price)
223
+ this.$price.html(variant.display_price)
224
224
  }
225
225
 
226
226
  this.updateVariantId = function() {
@@ -6,6 +6,7 @@ Spree.ready(function($) {
6
6
  if (this.mobileNavigation !== null) {
7
7
  this.burgerButton = document.querySelector('.navbar-toggler');
8
8
  this.closeButton = document.querySelector('#mobile-navigation-close-button');
9
+ this.mobileNavigationList = document.querySelector('.mobile-navigation-list');
9
10
  this.categoryLinks = document.querySelectorAll('.mobile-navigation-category-link');
10
11
  this.backButton = document.querySelector('#mobile-navigation-back-button');
11
12
  this.overlay = document.querySelector('#overlay');
@@ -14,7 +15,6 @@ Spree.ready(function($) {
14
15
 
15
16
  this.onResize = this.onResize.bind(this);
16
17
  this.onCategoryClick = this.onCategoryClick.bind(this);
17
- this.onTouchMove = this.onTouchMove.bind(this);
18
18
  this.onBurgerClick = this.onBurgerClick.bind(this);
19
19
  this.onCloseClick = this.onCloseClick.bind(this);
20
20
  this.onBackClick = this.onBackClick.bind(this);
@@ -23,7 +23,6 @@ Spree.ready(function($) {
23
23
  window.addEventListener('resize', this.onResize);
24
24
  window.addEventListener('turbolinks:request-start', this.onCloseClick);
25
25
 
26
- this.mobileNavigation.addEventListener('touchmove', this.onTouchMove, false);
27
26
  this.burgerButton.addEventListener('click', this.onBurgerClick, false);
28
27
  this.closeButton.addEventListener('click', this.onCloseClick, false);
29
28
  this.backButton.addEventListener('click', this.onBackClick, false);
@@ -45,10 +44,6 @@ Spree.ready(function($) {
45
44
  this.openCategory(category);
46
45
  }
47
46
 
48
- MobileNavigationManager.prototype.onTouchMove = function(e) {
49
- e.preventDefault();
50
- };
51
-
52
47
  MobileNavigationManager.prototype.onBurgerClick = function() {
53
48
  if (this.navigationOpen) {
54
49
  this.close();
@@ -84,6 +79,8 @@ Spree.ready(function($) {
84
79
  this.openedCategories.push(category);
85
80
  var subList = document.querySelector('ul[data-category=' + category + ']');
86
81
  if (subList) {
82
+ this.mobileNavigationList.classList.add('mobile-navigation-list-subcategory-shown');
83
+ this.mobileNavigationList.scrollTop = 0
87
84
  subList.classList.add('shown');
88
85
  this.backButton.classList.add('shown');
89
86
  }
@@ -99,6 +96,7 @@ Spree.ready(function($) {
99
96
  if (this.openedCategories[this.openedCategories.length - 1] === 'main') {
100
97
  this.backButton.classList.remove('shown');
101
98
  }
99
+ this.mobileNavigationList.classList.remove('mobile-navigation-list-subcategory-shown')
102
100
  return false;
103
101
  }
104
102
 
@@ -116,6 +114,7 @@ Spree.ready(function($) {
116
114
  var category = openedCategories.pop();
117
115
  this.closeCategory(category);
118
116
  }
117
+ this.mobileNavigationList.classList.remove('mobile-navigation-list-subcategory-shown')
119
118
  this.backButton.classList.remove('shown');
120
119
  }
121
120
 
@@ -227,6 +227,7 @@
227
227
  border-width: 1px !important;
228
228
  border-style: solid;
229
229
  color: color-yiq($input-background);
230
+ touch-action: manipulation;
230
231
  @include media-breakpoint-up(sm) {
231
232
  height: 51.4px;
232
233
  font-size: font-px-to-rem(24px);
@@ -17,6 +17,8 @@
17
17
  }
18
18
  &-list, &-sublist {
19
19
  margin: 0;
20
+ overflow-y: auto;
21
+ overflow-x: hidden;
20
22
  padding: 0 19px;
21
23
  &-item {
22
24
  padding: 16px 0;
@@ -39,6 +41,9 @@
39
41
  @include media-breakpoint-up(sm) {
40
42
  padding-top: $spree-header-tablet-height;
41
43
  }
44
+ &-subcategory-shown {
45
+ overflow-y: hidden;
46
+ }
42
47
  }
43
48
 
44
49
  &-sublist {
@@ -57,16 +57,7 @@ module Spree
57
57
  private
58
58
 
59
59
  def address_params
60
- params[:address].permit(:address,
61
- :firstname,
62
- :lastname,
63
- :address1,
64
- :address2,
65
- :city,
66
- :state_id,
67
- :zipcode,
68
- :country_id,
69
- :phone)
60
+ params.require(:address).permit(permitted_address_attributes)
70
61
  end
71
62
  end
72
63
  end
@@ -43,7 +43,7 @@ module Spree
43
43
  [
44
44
  current_store,
45
45
  current_currency,
46
- config_locale
46
+ I18n.locale
47
47
  ]
48
48
  end
49
49
 
@@ -33,5 +33,11 @@ module Spree
33
33
  content_tag(:noscript, form.text_field(:state_name, class: 'required')) +
34
34
  javascript_tag("document.write(\"<span class='d-block position-relative'>#{state_elements.html_safe}</span>\");")
35
35
  end
36
+
37
+ def user_available_addresses
38
+ return unless try_spree_current_user
39
+
40
+ try_spree_current_user.addresses.where(country: available_countries)
41
+ end
36
42
  end
37
43
  end
@@ -255,7 +255,7 @@ module Spree
255
255
  return '' if current_store.send(service).blank?
256
256
 
257
257
  link_to "https://#{service}.com/#{current_store.send(service)}", target: :blank, rel: 'nofollow noopener' do
258
- content_tag :gigure, id: service, class: 'px-2' do
258
+ content_tag :figure, id: service, class: 'px-2' do
259
259
  icon(name: service, width: 22, height: 22)
260
260
  end
261
261
  end
@@ -1,4 +1,4 @@
1
- <% @addresses = try_spree_current_user ? try_spree_current_user.addresses : [] %>
1
+ <% @addresses = try_spree_current_user ? user_available_addresses : [] %>
2
2
 
3
3
  <% if !try_spree_current_user || try_spree_current_user.email.blank? %>
4
4
  <div class="row">
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 4.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-02 00:00:00.000000000 Z
11
+ date: 2020-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_api
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 4.1.0
19
+ version: 4.1.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 4.1.0
26
+ version: 4.1.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: spree_core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 4.1.0
33
+ version: 4.1.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 4.1.0
40
+ version: 4.1.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bootstrap
43
43
  requirement: !ruby/object:Gem::Requirement