keystone_ui 0.29.4 → 0.29.5

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: afa5028a5fe85835a935f71471d3453fa8a30b22e9babc2b9f5bbb8c4526dc4d
4
- data.tar.gz: 4b1fd13215b77ce2246a7ee6def5c861b868d1467c1d2f448696541a84337533
3
+ metadata.gz: 5df45efe6cf162e4a96fa164e01d6ccdf623f8a84d14c530fd5dca4b42eec941
4
+ data.tar.gz: f1366496636edb0d10f9e50c4b75c4dddc21801634cce63ba67cf4bfe009dfd6
5
5
  SHA512:
6
- metadata.gz: c17714411a4f3053539495d92b0f5c4d588f08e9c821f3cc398ee343d3aeb521dccf80414e8756d7d83ce7f0860a80d5c10d24e183da193554fc5d99bafa2633
7
- data.tar.gz: 000fce6cd7976431aeef2d54bbcf7d5cad1c25182d04d7a0053939d48fa804e50612b53eb3e00b95df384db76cad5761437d373e91f18c80571bdc36a49bdf3e
6
+ metadata.gz: f249e58a7511397eab772a9e1c9c54c323c0583ddafe41c4da6741d54d8ee57e3590d9c400f75fbd7f5a71d4aa4b0fa30cb0f6223ee6ab817b0240ab539b976b
7
+ data.tar.gz: dd617c68d26134469be161339b9c0158a2cd39f4f95ee29d9f6e3546f85b4e60cc4009a2d30d431f31792c3dea9752489df8e48032493b5dde5ab872e5a12135
@@ -4,8 +4,7 @@ export default class extends Controller {
4
4
  static targets = ["button", "summary", "detail"]
5
5
 
6
6
  peek() {
7
- this.summaryTarget.classList.remove("hidden")
8
- this.place(this.summaryTarget)
7
+ this.show(this.summaryTarget)
9
8
  }
10
9
 
11
10
  unpeek() {
@@ -15,8 +14,7 @@ export default class extends Controller {
15
14
  toggle(event) {
16
15
  event.stopPropagation()
17
16
  const shown = this.hasDetailTarget ? this.detailTarget : this.summaryTarget
18
- shown.classList.toggle("hidden")
19
- if (!shown.classList.contains("hidden")) this.place(shown)
17
+ shown.classList.contains("hidden") ? this.show(shown) : shown.classList.add("hidden")
20
18
  }
21
19
 
22
20
  hide(event) {
@@ -28,9 +26,10 @@ export default class extends Controller {
28
26
  if (this.hasDetailTarget) this.detailTarget.classList.add("hidden")
29
27
  }
30
28
 
31
- place(shown) {
32
- const button = this.buttonTarget.getBoundingClientRect()
29
+ show(shown) {
33
30
  Object.assign(shown.style, { position: "fixed", right: "auto" })
31
+ shown.classList.remove("hidden")
32
+ const button = this.buttonTarget.getBoundingClientRect()
34
33
  Object.assign(shown.style, {
35
34
  top: `${button.bottom}px`,
36
35
  left: `${Math.max(8, button.right - shown.offsetWidth)}px`
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KeystoneUi
4
- VERSION = "0.29.4"
4
+ VERSION = "0.29.5"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keystone_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.29.4
4
+ version: 0.29.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Schneider