@dolphinweex/weex-vue-render 0.2.96 → 0.2.98
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 +49 -1
- package/package.json +1 -1
package/dist/index.common.js
CHANGED
|
@@ -2740,7 +2740,32 @@ 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');
|
|
2744
2769
|
/**
|
|
2745
2770
|
* why not to use window.screen.width to get screenWidth ? Because in some
|
|
2746
2771
|
* old webkit browser on android system it get the device pixel width, which
|
|
@@ -6189,6 +6214,7 @@ var scrollable$1 = {
|
|
|
6189
6214
|
created: function created () {
|
|
6190
6215
|
// should call resetLoadmore() to enable loadmore event.
|
|
6191
6216
|
this._loadmoreReset = true;
|
|
6217
|
+
this._scrollEndTimer = null;
|
|
6192
6218
|
},
|
|
6193
6219
|
|
|
6194
6220
|
mounted: function mounted () {
|
|
@@ -6382,6 +6408,24 @@ var scrollable$1 = {
|
|
|
6382
6408
|
},
|
|
6383
6409
|
|
|
6384
6410
|
handleScroll: function handleScroll (event) {
|
|
6411
|
+
if (this._scrollEndTimer) {
|
|
6412
|
+
clearTimeout(this._scrollEndTimer);
|
|
6413
|
+
}
|
|
6414
|
+
this._scrollEndTimer = setTimeout(() => {
|
|
6415
|
+
var wrapper = this.$refs.wrapper;
|
|
6416
|
+
if (wrapper && this._touchParams && this._touchParams.startTouchEvent) {
|
|
6417
|
+
fireEvent(wrapper, 'touchend', {
|
|
6418
|
+
source: 'scroll-debounce',
|
|
6419
|
+
changedTouches: [this._touchParams.startTouchEvent],
|
|
6420
|
+
touches: [],
|
|
6421
|
+
touchEvent: {
|
|
6422
|
+
changedTouches: [this._touchParams.startTouchEvent],
|
|
6423
|
+
touches: []
|
|
6424
|
+
}
|
|
6425
|
+
});
|
|
6426
|
+
}
|
|
6427
|
+
this.handleScrollEnd({ source: 'scroll-debounce' });
|
|
6428
|
+
}, 120);
|
|
6385
6429
|
// event.stopImmediatePropagation();
|
|
6386
6430
|
weex.utils.getThrottleLazyload(25, this.$el, 'scroll')();
|
|
6387
6431
|
getThrottledScroll(this)(event);
|
|
@@ -6522,6 +6566,10 @@ var scrollable$1 = {
|
|
|
6522
6566
|
|
|
6523
6567
|
handleTouchEnd: function handleTouchEnd (event) {
|
|
6524
6568
|
weex.sliderHorizontalScrolling = false;
|
|
6569
|
+
if (this._scrollEndTimer) {
|
|
6570
|
+
clearTimeout(this._scrollEndTimer);
|
|
6571
|
+
this._scrollEndTimer = null;
|
|
6572
|
+
}
|
|
6525
6573
|
if (!this._touchParams || !this._refresh && !this._loading) {
|
|
6526
6574
|
return
|
|
6527
6575
|
}
|
package/package.json
CHANGED