clapton 0.0.20 → 0.0.21

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: 81cd4cda35f3f05f9df998b38741783474c8ec88120fc4115bba162595299449
4
- data.tar.gz: 281d54281936bcfd3f35136419f4ebadbc051809efa38749d60859032eeb4f4b
3
+ metadata.gz: 27fa8b6f3ac907d41af32dc550fa4556dc127895ace2e296969b49b8dc8f887a
4
+ data.tar.gz: 8b5099fd20fc5f804d792c48da12b694755b18e8d51a9f65442ad61e1b2a7f6d
5
5
  SHA512:
6
- metadata.gz: bbcd0a11b60e9bae0c2e5e14332d3db99438dae9a1d97731bcb93c7ccd2757653ee1ac4e017864dbf4a90619b48e06817659d1051ebe87d2b28eeeeb074acd33
7
- data.tar.gz: 02d6310b781922e927a83908aa1238790a63c745d2900990b74c6a1ef7c9ead4a9194826a38db6d9f86155e631a4d2f1008a64c0f0a2fbca90fa323d8f29d791
6
+ metadata.gz: be4dabb30c708af3c0ce9b1cb0a20eb1b58d79924e2303c880b2d4b0a563eb304d906d456b105b24999baaaebb05053d618136de336c0b5b579581f07817a9b6
7
+ data.tar.gz: ddd55a8d86a0c9f5666c7fb686ed137c442e8d377341279856eb140d39a2eb08fe5538f05aa3be29ae9448ce1aee6e64eb0d93187c6bf8a1f45b1f4bdf44f12b
@@ -1448,3 +1448,12 @@ document.addEventListener("DOMContentLoaded", async () => {
1448
1448
  const event = new Event('clapton:render');
1449
1449
  document.dispatchEvent(event);
1450
1450
  });
1451
+ window.addEventListener('beforeunload', () => {
1452
+ sessionStorage.setItem('scrollPosition', window.scrollY.toString());
1453
+ });
1454
+ document.addEventListener("clapton:render", () => {
1455
+ const scrollPosition = sessionStorage.getItem('scrollPosition');
1456
+ if (scrollPosition) {
1457
+ window.scrollTo(0, parseInt(scrollPosition));
1458
+ }
1459
+ });
@@ -45,3 +45,14 @@ document.addEventListener("DOMContentLoaded", async () => {
45
45
  const event = new Event('clapton:render');
46
46
  document.dispatchEvent(event);
47
47
  });
48
+
49
+ window.addEventListener('beforeunload', () => {
50
+ sessionStorage.setItem('scrollPosition', window.scrollY.toString());
51
+ });
52
+
53
+ document.addEventListener("clapton:render", () => {
54
+ const scrollPosition = sessionStorage.getItem('scrollPosition');
55
+ if (scrollPosition) {
56
+ window.scrollTo(0, parseInt(scrollPosition));
57
+ }
58
+ });
@@ -1,3 +1,3 @@
1
1
  module Clapton
2
- VERSION = '0.0.20'
2
+ VERSION = '0.0.21'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clapton
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moeki Kawakami