@dolphinweex/weex-vue-render 0.2.96 → 0.2.97
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/dist/index.common.js +52 -1
- package/package.json +1 -1
package/dist/index.common.js
CHANGED
|
@@ -2740,7 +2740,35 @@ function init$1 (viewportWidth) {
|
|
|
2740
2740
|
// set root font for rem.
|
|
2741
2741
|
setRootFont(screenWidth, viewportWidth);
|
|
2742
2742
|
setMetaViewport(viewportWidth);
|
|
2743
|
-
|
|
2743
|
+
var _viewportWidthForFix = viewportWidth;
|
|
2744
|
+
var _checkAndFix = function (delay, label) {
|
|
2745
|
+
setTimeout(function () {
|
|
2746
|
+
var newWidth = doc.documentElement.clientWidth;
|
|
2747
|
+
var newHeight = doc.documentElement.clientHeight;
|
|
2748
|
+
console.log('[px2rem] poll@' + label + ': clientWidth=' + newWidth + ' (was ' + screenWidth + ')');
|
|
2749
|
+
if (newWidth > screenWidth) {
|
|
2750
|
+
console.log('[px2rem] poll@' + label + ' FIX triggered: ' + screenWidth + ' -> ' + newWidth);
|
|
2751
|
+
screenWidth = newWidth;
|
|
2752
|
+
screenHeight = newHeight;
|
|
2753
|
+
setRootFont(screenWidth, _viewportWidthForFix, true);
|
|
2754
|
+
var newScale = screenWidth / _viewportWidthForFix;
|
|
2755
|
+
document.documentElement.style.setProperty('--harmory-density-scale', newScale);
|
|
2756
|
+
extend(info, {
|
|
2757
|
+
scale: newScale,
|
|
2758
|
+
deviceWidth: screenWidth * dpr,
|
|
2759
|
+
deviceHeight: screenHeight * dpr
|
|
2760
|
+
});
|
|
2761
|
+
console.log('[px2rem] poll@' + label + ' applied: fontSize=' + doc.documentElement.style.fontSize + ', scale=' + newScale);
|
|
2762
|
+
}
|
|
2763
|
+
}, delay);
|
|
2764
|
+
};
|
|
2765
|
+
_checkAndFix(100, '100ms');
|
|
2766
|
+
_checkAndFix(300, '300ms');
|
|
2767
|
+
_checkAndFix(600, '600ms');
|
|
2768
|
+
_checkAndFix(1000, '1000ms');
|
|
2769
|
+
window.addEventListener('resize', function () {
|
|
2770
|
+
_checkAndFix(0, 'resize');
|
|
2771
|
+
});
|
|
2744
2772
|
/**
|
|
2745
2773
|
* why not to use window.screen.width to get screenWidth ? Because in some
|
|
2746
2774
|
* old webkit browser on android system it get the device pixel width, which
|
|
@@ -6189,6 +6217,7 @@ var scrollable$1 = {
|
|
|
6189
6217
|
created: function created () {
|
|
6190
6218
|
// should call resetLoadmore() to enable loadmore event.
|
|
6191
6219
|
this._loadmoreReset = true;
|
|
6220
|
+
this._scrollEndTimer = null;
|
|
6192
6221
|
},
|
|
6193
6222
|
|
|
6194
6223
|
mounted: function mounted () {
|
|
@@ -6382,6 +6411,24 @@ var scrollable$1 = {
|
|
|
6382
6411
|
},
|
|
6383
6412
|
|
|
6384
6413
|
handleScroll: function handleScroll (event) {
|
|
6414
|
+
if (this._scrollEndTimer) {
|
|
6415
|
+
clearTimeout(this._scrollEndTimer);
|
|
6416
|
+
}
|
|
6417
|
+
this._scrollEndTimer = setTimeout(() => {
|
|
6418
|
+
var wrapper = this.$refs.wrapper;
|
|
6419
|
+
if (wrapper && this._touchParams && this._touchParams.startTouchEvent) {
|
|
6420
|
+
fireEvent(wrapper, 'touchend', {
|
|
6421
|
+
source: 'scroll-debounce',
|
|
6422
|
+
changedTouches: [this._touchParams.startTouchEvent],
|
|
6423
|
+
touches: [],
|
|
6424
|
+
touchEvent: {
|
|
6425
|
+
changedTouches: [this._touchParams.startTouchEvent],
|
|
6426
|
+
touches: []
|
|
6427
|
+
}
|
|
6428
|
+
});
|
|
6429
|
+
}
|
|
6430
|
+
this.handleScrollEnd({ source: 'scroll-debounce' });
|
|
6431
|
+
}, 120);
|
|
6385
6432
|
// event.stopImmediatePropagation();
|
|
6386
6433
|
weex.utils.getThrottleLazyload(25, this.$el, 'scroll')();
|
|
6387
6434
|
getThrottledScroll(this)(event);
|
|
@@ -6522,6 +6569,10 @@ var scrollable$1 = {
|
|
|
6522
6569
|
|
|
6523
6570
|
handleTouchEnd: function handleTouchEnd (event) {
|
|
6524
6571
|
weex.sliderHorizontalScrolling = false;
|
|
6572
|
+
if (this._scrollEndTimer) {
|
|
6573
|
+
clearTimeout(this._scrollEndTimer);
|
|
6574
|
+
this._scrollEndTimer = null;
|
|
6575
|
+
}
|
|
6525
6576
|
if (!this._touchParams || !this._refresh && !this._loading) {
|
|
6526
6577
|
return
|
|
6527
6578
|
}
|
package/package.json
CHANGED