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 +8 -0
- package/dist/umd/locizify.js +16 -7
- package/dist/umd/locizify.min.js +1 -1
- package/locizify.js +16 -7
- package/locizify.min.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/dist/umd/locizify.js
CHANGED
|
@@ -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
|
-
|
|
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(
|
|
12346
|
-
var rect =
|
|
12347
|
-
|
|
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.
|
|
12368
|
+
ny1 = off.top + document.documentElement.scrollTop,
|
|
12360
12369
|
ny2 = ny1 + $n.offsetHeight,
|
|
12361
|
-
nx1 = off.left + document.
|
|
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% -
|
|
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);
|