word-games-theme 2.9.6 → 2.9.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/assets/js/theme.js +16 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4cdc2afd0e570d207ead4677ebf3eb23ba3f68724ed092c9988d94bed79aa0a
4
- data.tar.gz: 566c252604863daad298e81d96167e9b5a345b64c7674288f61d91ceae79277f
3
+ metadata.gz: 9c98904560055d0f2c42398d1b9e4b7ac197e0e74870dc2467c431c12a87a52e
4
+ data.tar.gz: 55241b01608d1d986b1a4422c3f30af16a82d17bd668195a77be05f818321c54
5
5
  SHA512:
6
- metadata.gz: f5688c177b39d42fb44ada6bf115a5f0f619dec711a1f1a296191d383f565c07a08fa6f6235edfae8883be1d55bde178fffa7dd001e160d5b7adc48c6a7afe6a
7
- data.tar.gz: 04afdd27295eeff067f1f484885bbdfa1f7dd53e64e250c1fe771ccb53b9dec1556dc3c9def588bdd42fbbb24bf192a8f26345ac1dca4014618afea6bc60e1a9
6
+ metadata.gz: f116421297f717576fc2020da33ed2c100a1643b5f5a48274d5b90bd228cb61a4c01024447655c03f59cd43624887c8e20b15293e8d578d961264276aed19842
7
+ data.tar.gz: 9e4039a255d4a41a48892d21658977c4bbee65d6f7c6bd95f1e71ea993f718291c9e0448dbca2b67dbec068d92c847bb760cc67f652c0f4b9fa6714d451b96bc
data/assets/js/theme.js CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  ---
3
3
 
4
- console.log(document.querySelectorAll('*').length);
4
+ console.log(document.querySelectorAll('*').length);
5
5
  if ("{{ site.removeBootstrapJs }}" === "true") {
6
6
  const languagesModal = document.querySelector("#staticBackdrop");
7
7
  const intModalBtn = document.querySelector("#int-modal-btn");
@@ -24,7 +24,7 @@ if ("{{ site.removeBootstrapJs }}" === "true") {
24
24
  }
25
25
 
26
26
  var mediaQuery = window.matchMedia("(max-width: 768px)")
27
-
27
+
28
28
  const wordGamesToolbarListItems = document.querySelectorAll(
29
29
  ".wordgames-toolbar-list-item-span"
30
30
  );
@@ -72,19 +72,19 @@ if ("{{ site.removeBootstrapJs }}" === "true") {
72
72
 
73
73
  }
74
74
 
75
- const worker = new Worker('/assets/js/search-worker.js');
75
+ const searchWorker = new Worker('/assets/js/search-worker.js');
76
76
  function fetchData() {
77
77
  return new Promise((resolve, reject) => {
78
- worker.postMessage({
78
+ searchWorker.postMessage({
79
79
  type: "api",
80
80
  endpoint: `/alllinks.json`
81
81
  });
82
82
 
83
- worker.onmessage = (event) => {
83
+ searchWorker.onmessage = (event) => {
84
84
  resolve(event.data.data.featuredLinks);
85
85
  };
86
86
 
87
- worker.onerror = (error) => {
87
+ searchWorker.onerror = (error) => {
88
88
  reject(error);
89
89
  };
90
90
  });
@@ -102,6 +102,12 @@ function displayResults(results) {
102
102
  const searchInput = document.querySelector('.searchBar input');
103
103
  let data;
104
104
  searchInput.addEventListener('input', async (event) => {
105
+ if (searchInput.value !== '') {
106
+ searchInput.classList.add('blinkBoxShadow');
107
+ } else {
108
+ searchInput.classList.remove('blinkBoxShadow');
109
+ }
110
+
105
111
  const query = event.target.value;
106
112
  if (!data) {
107
113
  // Fetch the data only if it hasn't been fetched before
@@ -116,6 +122,10 @@ searchInput.addEventListener('input', async (event) => {
116
122
  'value': query
117
123
  });
118
124
  });
125
+ searchInput.addEventListener('blur', () => {
126
+ searchInput.classList.remove('blinkBoxShadow');
127
+ });
128
+
119
129
  document.addEventListener('click', (event) => {
120
130
  const resultsContainer = document.getElementById('results');
121
131
  if (!searchInput.contains(event.target) && !resultsContainer.contains(event.target)) {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: word-games-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.6
4
+ version: 2.9.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - manpreet-appscms