satis 2.1.9 → 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: dc6031f7746bd883c8cd678ce58740dc3aad06c3a092a6da92bac2c92d3c0d18
4
- data.tar.gz: ba326c73a8ec4b5595c11a4ffe038c3af707a483ace1953fb745da46d11c20c0
3
+ metadata.gz: c26f92789c969a70a78e755e1e4524ce60eb66e4072e668347a043dfbec44035
4
+ data.tar.gz: fd1bcf71ddb41868eef1f4832851a7cfd5c0a9d758c1fabff852cae2ef20b140
5
5
  SHA512:
6
- metadata.gz: 923734b20873685e94daf82265875d5d28b0366c7cee5e3b64e7eacc6b0b5051ebb119ca53e2cca8b71a621a6a2bd8a4b88e88e07dec94fab380e88a60af559c
7
- data.tar.gz: 4b6c5bdd8f2ef8dfc27e2efaaadce747eea5eec3d6464a4c2aa8623d80956aecf4310f549dab4db6b59901965804cfd2b20b640608793e1a2ea44db362fcccbd
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;
@@ -27,13 +27,13 @@ module Satis
27
27
  end
28
28
 
29
29
  # Regular input
30
- def input(method, options = {}, &)
30
+ def input(method, options = {}, &block)
31
31
  @form_options = options
32
32
 
33
33
  options[:input_html] ||= {}
34
34
  options[:input_html][:disabled] = options.delete(:disabled)
35
35
 
36
- send(input_type_for(method, options), method, options, &)
36
+ send(input_type_for(method, options), method, options, &block)
37
37
  end
38
38
 
39
39
  # NOTE: TDG - seems to be overwritten below
@@ -44,14 +44,14 @@ module Satis
44
44
  # end
45
45
 
46
46
  # A codemirror editor, backed by a text-area
47
- def editor(method, options = {}, &)
47
+ def editor(method, options = {}, &block)
48
48
  @form_options = options
49
49
 
50
- editor_input(method, options, &)
50
+ editor_input(method, options, &block)
51
51
  end
52
52
 
53
53
  # Simple-form like association
54
- def association(name, options, &)
54
+ def association(name, options, &block)
55
55
  @form_options = options
56
56
 
57
57
  @association = name
@@ -59,7 +59,7 @@ module Satis
59
59
 
60
60
  method = reflection.join_foreign_key
61
61
 
62
- send(input_type_for(method, options), method, options, &)
62
+ send(input_type_for(method, options), method, options, &block)
63
63
  end
64
64
 
65
65
  alias_method :rails_fields_for, :fields_for
@@ -73,7 +73,7 @@ module Satis
73
73
  # printers_form.input :name
74
74
  # end
75
75
  # end
76
- def fields_for(*args, &)
76
+ def fields_for(*args, &block)
77
77
  options = args.extract_options!
78
78
  name = args.first
79
79
  template_object = args.second
@@ -121,7 +121,7 @@ module Satis
121
121
  end
122
122
  safe_join [
123
123
  invalid_feedback,
124
- rails_fields_for(*args, options, &)
124
+ rails_fields_for(*args, options, &block)
125
125
  ].compact
126
126
  end
127
127
  end
@@ -137,17 +137,17 @@ module Satis
137
137
  end
138
138
 
139
139
  # A switch backed by a hidden value
140
- def switch(method, options = {}, &)
140
+ def switch(method, options = {}, &block)
141
141
  @form_options = options
142
142
 
143
- switch_input(method, options, &)
143
+ switch_input(method, options, &block)
144
144
  end
145
145
 
146
146
  # A hidden input
147
- def hidden(method, options = {}, &)
147
+ def hidden(method, options = {}, &block)
148
148
  @form_options = options
149
149
 
150
- hidden_input(method, options, &)
150
+ hidden_input(method, options, &block)
151
151
  end
152
152
 
153
153
  # Non public
data/lib/satis/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Satis
2
- VERSION = "2.1.9"
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.9
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-27 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