satis 2.1.10 → 2.1.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c555864ef12ead60d3c49092fd523d24fd5f1778f5c4ad834a12e2bda16d7c67
4
- data.tar.gz: b0347be5e202f0fc3843b994379b42f7f96b3b5ac5f2efef34d5433eba35a959
3
+ metadata.gz: c26f92789c969a70a78e755e1e4524ce60eb66e4072e668347a043dfbec44035
4
+ data.tar.gz: fd1bcf71ddb41868eef1f4832851a7cfd5c0a9d758c1fabff852cae2ef20b140
5
5
  SHA512:
6
- metadata.gz: a5082b696cc734bd44c6f1ad497135d8d64512cd8964fb778dd6377fbea08b62c78be0c42ced5971e9196f1078c8c457154251fcdbd980116f9d98750112e12d
7
- data.tar.gz: c81ac8c1b03041cf1e31464339f98de4dd93783ab3f6d9d1beac95a7dce7516460ac044b14817a2e67d76cd3558fc117fec204410a91ee510e4f004fe9fbffa1
6
+ metadata.gz: a05e0503425e84529bf1a0c07a0de2d5a2704178a745854ea1a10c29345c580cedff250ed16a3e6839ce91a0d2e45f43b400000666ce3f56bfb7bd49097400b6
7
+ data.tar.gz: 1775ac23357c5d75fe779c2514fa54a7458be686796a07f17a79a8ee14f8d626797eb18a34d5b13caac8a4e0c114dfbbb971eda24223bd22232233435d45dbdd
@@ -36,13 +36,11 @@ export default class SidebarMenuItemComponentController extends ApplicationContr
36
36
  this.showSubmenu()
37
37
  event.preventDefault()
38
38
  } else {
39
- this.hideSubmenu()
39
+ if(!this.hasLink || this.linkInUrl()) this.hideSubmenu()
40
40
  }
41
41
 
42
- if (this.linkTarget.classList.contains("focus")) {
42
+ if(this.linkInUrl()){
43
43
  event.preventDefault()
44
- } else {
45
- this.linkTarget.classList.toggle("focus", true)
46
44
  }
47
45
  }
48
46
  }
@@ -70,8 +68,12 @@ export default class SidebarMenuItemComponentController extends ApplicationContr
70
68
  this.element.classList.toggle("active", false)
71
69
  }
72
70
 
71
+ get hasLink(){
72
+ return this.hasLinkTarget && this.linkTarget.hasAttribute("href")
73
+ }
74
+
73
75
  updateFocus(scroll = false) {
74
- if (!this.hasLinkTarget) return
76
+ if (!this.hasLink) return
75
77
  const focusedItem = this.element.closest('nav.sidebar').querySelector('a.focus')
76
78
  const linkInUrl = this.linkInUrl()
77
79
  if (linkInUrl && (!focusedItem || linkInUrl > this.linkInUrl(focusedItem))) {
@@ -83,7 +85,7 @@ export default class SidebarMenuItemComponentController extends ApplicationContr
83
85
  }
84
86
 
85
87
  linkInUrl(target = this.linkTarget) {
86
- if(!target || target.href.length === 0 || target.pathname !== window.location.pathname || target.origin !== window.location.origin)
88
+ if(!target || target.getAttribute('href') === null || target.pathname !== window.location.pathname || target.origin !== window.location.origin)
87
89
  return 0
88
90
 
89
91
  let c = 1;
data/lib/satis/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Satis
2
- VERSION = "2.1.10"
2
+ VERSION = "2.1.11"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: satis
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.10
4
+ version: 2.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom de Grunt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-29 00:00:00.000000000 Z
11
+ date: 2024-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: browser