peeker 0.1.4 → 0.1.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
  SHA1:
3
- metadata.gz: 56f2b1931a2d7e82008da14da53d8414178f5c74
4
- data.tar.gz: b61c876d526d7fae864619b26b5f865ec008865e
3
+ metadata.gz: 1081862fe1947131508d3575a8e7e2a71888af57
4
+ data.tar.gz: f4ba9e98a4c869e2be6492b1126ebba3e882cbb9
5
5
  SHA512:
6
- metadata.gz: 1d48fba8e703ed1abcd1d9c443ed1722d29dc3dcd6526f16dbabb2dd5cfd157ff45363e17c0b3848a767e7d8d320d410a6999ab6766877d6b46ce181976eea18
7
- data.tar.gz: 61b3f0eaab03d3d64011df141d06efe47a5bc1e76f4f5f1b3fd2d9c95794cd05d56c05bc677c638798c200b3ebc51315b09e5bf0ac38c8388e0030c410b06cc3
6
+ metadata.gz: a9f4572f23b35e525d8f6fc946c004082839cbe9886bb2d5f243ad29cc8b56787f72a0bbbc20ad31716a218d212b61835b097f93b33a7d15ae41df99e159a05e
7
+ data.tar.gz: b300925d4c65de224fa90a86d015b075aeb0edc5c396441b096de96cf0c69f0c1e82ab57e55fdb745e3741235f5ba09355787172309f488c75635f358e364620
@@ -2,14 +2,13 @@
2
2
 
3
3
  // Find peek element
4
4
  var peekElement = document.querySelector("#peek");
5
- var socialPlugins = document.querySelectorAll(".social-plugin");
5
+
6
6
  // Check existence of peek element
7
7
  if (!peekElement)
8
8
  return false;
9
9
 
10
- // Initialize social-plugin style with localStorage
11
- var display = localStorage.getItem("peekStatus");
12
- setSocialPluginStyleInBlogIndex(socialPlugins, display);
10
+ // Build event
11
+ var event = new Event('peek');
13
12
 
14
13
  // Listener Class
15
14
  var Listener = function (target, handler) {
@@ -29,10 +28,9 @@
29
28
 
30
29
  // Handler
31
30
  var handler = function () {
32
- var display = getPeekStatusFromLocalStorage();
33
- peekElement.style.display = display;
34
- setSocialPluginStyleInBlogIndex(socialPlugins, display);
31
+ peekElement.style.display = (localStorage.getItem("peekStatus") == "none") ? "block" : "none";
35
32
  localStorage.setItem("peekStatus", peekElement.style.display);
33
+ window.dispatchEvent(event);
36
34
  };
37
35
 
38
36
  // Set peekStatus with localStorage
@@ -50,16 +48,3 @@
50
48
  });
51
49
 
52
50
  })(window, document);
53
-
54
-
55
- function setSocialPluginStyleInBlogIndex(socialPlugins, display) {
56
- if (!!socialPlugins.length) {
57
- for(var i = 0; i < socialPlugins.length; i++) {
58
- socialPlugins[i].style.display = display;
59
- }
60
- }
61
- }
62
-
63
- function getPeekStatusFromLocalStorage() {
64
- return (localStorage.getItem("peekStatus") == "none") ? "block" : "none";
65
- }
@@ -1,3 +1,3 @@
1
1
  module Peeker
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peeker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - frozenfung