locizify 6.0.2 → 6.0.4

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 6.0.4
2
+
3
+ - update locize plugin
4
+
5
+ ### 6.0.3
6
+
7
+ - update locize plugin
8
+
1
9
  ### 6.0.2
2
10
 
3
11
  - update locize plugin
@@ -9732,10 +9732,15 @@
9732
9732
  },
9733
9733
  requestInitialize: function requestInitialize(payload) {
9734
9734
  sendMessage('requestInitialize', payload);
9735
+ if (api.initInterval) return;
9735
9736
  api.initInterval = setInterval(function () {
9736
9737
  repeat = repeat - 1;
9737
9738
  api.requestInitialize(payload);
9738
- if (repeat < 0 && api.initInterval) clearInterval(api.initInterval);
9739
+
9740
+ if (repeat < 0 && api.initInterval) {
9741
+ clearInterval(api.initInterval);
9742
+ delete api.initInterval;
9743
+ }
9739
9744
  }, 1000);
9740
9745
  },
9741
9746
  selectKey: function selectKey(meta) {
@@ -12342,9 +12347,13 @@
12342
12347
  };
12343
12348
  }
12344
12349
 
12345
- function isInViewport(element) {
12346
- var rect = element.getBoundingClientRect();
12347
- return rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth);
12350
+ function isInViewport(el) {
12351
+ var rect = el.getBoundingClientRect();
12352
+ var windowHeight = window.innerHeight || document.documentElement.clientHeight;
12353
+ var windowWidth = window.innerWidth || document.documentElement.clientWidth;
12354
+ var vertInView = rect.top <= windowHeight && rect.top + rect.height >= 0;
12355
+ var horInView = rect.left <= windowWidth && rect.left + rect.width >= 0;
12356
+ return vertInView && horInView;
12348
12357
  }
12349
12358
 
12350
12359
  function mouseDistanceFromElement(mouseEvent, element) {
@@ -12356,9 +12365,9 @@
12356
12365
  y: mY
12357
12366
  },
12358
12367
  off = $n.getBoundingClientRect(),
12359
- ny1 = off.top + document.body.scrollTop,
12368
+ ny1 = off.top + document.documentElement.scrollTop,
12360
12369
  ny2 = ny1 + $n.offsetHeight,
12361
- nx1 = off.left + document.body.scrollLeft,
12370
+ nx1 = off.left + document.documentElement.scrollLeft,
12362
12371
  nx2 = nx1 + $n.offsetWidth,
12363
12372
  maxX1 = Math.max(mX, nx1),
12364
12373
  minX2 = Math.min(mX, nx2),
@@ -12599,7 +12608,7 @@
12599
12608
  var iframe = document.createElement('iframe');
12600
12609
  iframe.setAttribute('id', 'i18next-editor-iframe');
12601
12610
  iframe.setAttribute('data-i18next-editor-element', 'true');
12602
- iframe.style = "\n z-index: 100;\n width: 100%;\n height: calc(100% - 32px);\n border: none;\n background: #fff;\n ";
12611
+ iframe.style = "\n z-index: 100;\n width: 100%;\n height: calc(100% - 28px);\n border: none;\n background: #fff;\n ";
12603
12612
  iframe.setAttribute('src', url);
12604
12613
  iframe.addEventListener('load', cb);
12605
12614
  popup.appendChild(iframe);