Created
June 22, 2017 10:33
-
-
Save 0xlitf/a53741cac92fedbccad277ce5d9f981e to your computer and use it in GitHub Desktop.
Revisions
-
4u1kto created this gist
Jun 22, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ function once(fn, context) { var result return function () { if (fn) { result = fn.apply(context || this, arguments) fn = null } return result } } property var showNotification onDraggingVerticallyChanged: { showNotification = once(function () { notification.show("上拉加载") }) } onContentYChanged: { if (draggingVertically && contentHeight > height && contentY - originY > contentHeight - height) { var dy = (contentY - originY) - (contentHeight - height) if (dy > 40 && model.count >= 100) { showNotification() } } }