Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

add reference to scroller to ptr/ptl callbacks #22

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/plugins/pull-to-load-more.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
labelSubtitle : '',
labelError : 'Error on pull to load more'
},

PULL_TO_SNAP_TIME = 200,
ERROR_TIMEOUT = 1000,
CLASS_UPDATE_STATE = 'update',
Expand All @@ -48,7 +48,7 @@
CLASS_LABEL = 'label',
CLASS_SUBTITLE = 'sub',
CLASS_PTL = 'pullToLoadMore';

function PullToLoadMore() {}

PullToLoadMore.prototype = {
Expand Down Expand Up @@ -76,7 +76,7 @@
}
this.opts.pullToLoadMoreConfig = ptlConfig;
},

triggerPTL: function () {
//set waiting state
if (!this._ptlLoading) {
Expand Down Expand Up @@ -242,7 +242,7 @@
};

if (ptrDataProvider) {
ptrDataProvider(callback);
ptrDataProvider(callback, self);
} else {
w.setTimeout(function (){
self._ptlExecTriggerCallback('no fnc');
Expand Down Expand Up @@ -317,4 +317,4 @@

PLUGINS.PullToLoadMore = PullToLoadMore;

}(window));
}(window));
16 changes: 8 additions & 8 deletions src/plugins/pull-to-refresh.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
(function (w) {
'use strict';
w || (w = window);

// NAMESPACES
var SCROLLER = w.__S || (w.__S = {}),
RAF = w.requestAnimationFrame,
Expand Down Expand Up @@ -49,7 +49,7 @@
CLASS_LABEL = 'label',
CLASS_SUBTITLE = 'sub',
CLASS_PTR = 'pullToRefresh';

function PullToRefresh() {}

PullToRefresh.DEFAULTS = CONFIG_DEFAULTS;
Expand Down Expand Up @@ -147,7 +147,7 @@
this._iosTouching = false;
this._end(e);
}.bind(this));

},
//TODO: FIX clicking for PTR
_appendPullToRefresh: function () {
Expand Down Expand Up @@ -246,10 +246,10 @@
return this._needsPullToRefresh(y);
}

if (isPTRNative) {
if (isPTRNative) {
if (y > -this._ptrSize) {
this.ptrDOM.style[STYLES.transform] = 'translate3d(0,' + (50 + y) + 'px,0)';
}
}
}
},
_onScrollEndPTR: function (e) {
Expand Down Expand Up @@ -291,7 +291,7 @@
};

if (ptrDataProvider) {
ptrDataProvider(callback);
ptrDataProvider(callback, self);
} else {
w.setTimeout(function (){
self._ptrExecTriggerCallback('handler not defined');
Expand All @@ -316,7 +316,7 @@
self._resetPosition(self._ptrSnapTime);
});
}

},
/*
* ==================================
Expand Down Expand Up @@ -366,4 +366,4 @@

PLUGINS.PullToRefresh = PullToRefresh;

}(window));
}(window));