Skip to content

Commit

Permalink
build: package
Browse files Browse the repository at this point in the history
  • Loading branch information
dolymood committed Jun 4, 2019
1 parent a11081c commit d2ae1ba
Show file tree
Hide file tree
Showing 14 changed files with 498 additions and 176 deletions.
4 changes: 2 additions & 2 deletions lib/cube.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/drawer/drawer.min.js

Large diffs are not rendered by default.

92 changes: 69 additions & 23 deletions lib/drawer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5817,11 +5817,12 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
beforePullDown: true,
isPullingDown: false,
isPullUpLoad: false,
pullUpDirty: true,
pullUpNoMore: false,
bubbleY: 0,
pullDownStyle: '',
pullDownStop: 40,
pullDownHeight: 60
pullDownHeight: 60,
pullUpHeight: 0
};
},

Expand All @@ -5845,7 +5846,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
var moreTxt = txt && txt.more || '';
var noMoreTxt = txt && txt.noMore || '';

return this.pullUpDirty ? moreTxt : noMoreTxt;
return this.pullUpNoMore ? noMoreTxt : moreTxt;
},
refreshTxt: function refreshTxt() {
var pullDownRefresh = this.pullDownRefresh;
Expand Down Expand Up @@ -5879,14 +5880,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
this.scroll.openPullDown(newVal);
if (!oldVal) {
this._onPullDownRefresh();
this._calculateMinHeight();
this._pullDownRefreshChangeHandler();
}
}

if (!newVal && oldVal) {
this.scroll.closePullDown();
this._offPullDownRefresh();
this._calculateMinHeight();
this._pullDownRefreshChangeHandler();
}
},

Expand All @@ -5898,14 +5899,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
this.scroll.openPullUp(newVal);
if (!oldVal) {
this._onPullUpLoad();
this._calculateMinHeight();
this._pullUpLoadChangeHandler();
}
}

if (!newVal && oldVal) {
this.scroll.closePullUp();
this._offPullUpLoad();
this._calculateMinHeight();
this._pullUpLoadChangeHandler();
}
},

Expand Down Expand Up @@ -5949,12 +5950,13 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
this._listenScrollEvents();

if (this.pullDownRefresh) {
this._getPullDownEleHeight();
this._onPullDownRefresh();
this._pullDownRefreshChangeHandler();
}

if (this.pullUpLoad) {
this._onPullUpLoad();
this._pullUpLoadChangeHandler();
}
},
disable: function disable() {
Expand Down Expand Up @@ -5984,6 +5986,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
var _this3 = this;

var dirty = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
var nomore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

if (this.pullDownRefresh && this.isPullingDown) {
this.isPullingDown = false;
Expand All @@ -5993,14 +5996,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
} else if (this.pullUpLoad && this.isPullUpLoad) {
this.isPullUpLoad = false;
this.scroll.finishPullUp();
this.pullUpDirty = dirty;
this.pullUpNoMore = !dirty || nomore;
dirty && this.refresh();
} else {
dirty && this.refresh();
}
},
resetPullUpTxt: function resetPullUpTxt() {
this.pullUpDirty = true;
this.pullUpNoMore = false;
},
_listenScrollEvents: function _listenScrollEvents() {
var _this4 = this;
Expand Down Expand Up @@ -6088,9 +6091,23 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
return reachBoundary;
},
_calculateMinHeight: function _calculateMinHeight() {
if (this.$refs.listWrapper) {
this.$refs.listWrapper.style.minHeight = this.pullDownRefresh || this.pullUpLoad ? (0, _dom.getRect)(this.$refs.wrapper).height + 1 + 'px' : 0;
var _$refs = this.$refs,
wrapper = _$refs.wrapper,
listWrapper = _$refs.listWrapper;

var pullUpLoad = this.pullUpLoad;
var pullDownRefresh = this.pullDownRefresh;
var minHeight = 0;

if (pullDownRefresh || pullUpLoad) {
var wrapperHeight = (0, _dom.getRect)(wrapper).height;
minHeight = wrapperHeight + 1;
if (pullUpLoad && pullUpLoad.visible) {
minHeight -= this.pullUpHeight;
}
}

listWrapper.style.minHeight = minHeight + 'px';
},
_onPullDownRefresh: function _onPullDownRefresh() {
this.scroll.on('pullingDown', this._pullDownHandle);
Expand All @@ -6100,6 +6117,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
this.scroll.off('pullingDown', this._pullDownHandle);
this.scroll.off('scroll', this._pullDownScrollHandle);
},
_pullDownRefreshChangeHandler: function _pullDownRefreshChangeHandler() {
var _this6 = this;

this.$nextTick(function () {
_this6._getPullDownEleHeight();
_this6._calculateMinHeight();
});
},
_pullDownHandle: function _pullDownHandle() {
if (this.resetPullDownTimer) {
clearTimeout(this.resetPullDownTimer);
Expand All @@ -6117,6 +6142,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
this.pullDownStyle = 'top:' + Math.min(pos.y - this.pullDownStop, 0) + 'px';
}
},
_pullUpLoadChangeHandler: function _pullUpLoadChangeHandler() {
var _this7 = this;

this.$nextTick(function () {
_this7._getPullUpEleHeight();
_this7._calculateMinHeight();
});
},
_onPullUpLoad: function _onPullUpLoad() {
this.scroll.on('pullingUp', this._pullUpHandle);
},
Expand All @@ -6128,39 +6161,52 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
this.$emit(EVENT_PULLING_UP);
},
_reboundPullDown: function _reboundPullDown(next) {
var _this6 = this;
var _this8 = this;

var _pullDownRefresh$stop = this.pullDownRefresh.stopTime,
stopTime = _pullDownRefresh$stop === undefined ? DEFAULT_STOP_TIME : _pullDownRefresh$stop;

setTimeout(function () {
_this6.scroll.finishPullDown();
_this8.scroll.finishPullDown();
next();
}, stopTime);
},
_afterPullDown: function _afterPullDown(dirty) {
var _this7 = this;
var _this9 = this;

this.resetPullDownTimer = setTimeout(function () {
_this7.pullDownStyle = 'top: -' + _this7.pullDownHeight + 'px';
_this7.beforePullDown = true;
dirty && _this7.refresh();
_this9.pullDownStyle = 'top: -' + _this9.pullDownHeight + 'px';
_this9.beforePullDown = true;
dirty && _this9.refresh();
}, this.scroll.options.bounceTime);
},
_getPullDownEleHeight: function _getPullDownEleHeight() {
var _this8 = this;
var _this10 = this;

var pulldown = this.$refs.pulldown.firstChild;
var pulldown = this.$refs.pulldown;
if (!pulldown) {
return;
}
pulldown = pulldown.firstChild;
this.pullDownHeight = (0, _dom.getRect)(pulldown).height;

this.beforePullDown = false;
this.isPullingDown = true;
this.$nextTick(function () {
_this8.pullDownStop = (0, _dom.getRect)(pulldown).height;
_this10.pullDownStop = (0, _dom.getRect)(pulldown).height;

_this8.beforePullDown = true;
_this8.isPullingDown = false;
_this10.beforePullDown = true;
_this10.isPullingDown = false;
});
},
_getPullUpEleHeight: function _getPullUpEleHeight() {
var listWrapper = this.$refs.listWrapper;
var pullup = listWrapper.nextElementSibling;
if (!pullup) {
this.pullUpHeight = 0;
return;
}
this.pullUpHeight = (0, _dom.getRect)(pullup).height;
}
},
components: {
Expand Down
6 changes: 3 additions & 3 deletions lib/image-preview/image-preview.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit d2ae1ba

Please sign in to comment.