ux-datagrid-iscroll.min.js |
|
! ux-angularjs-datagrid v.1.4.11 (c) 2016, Obogo https://github.com/obogo/ux-angularjs-datagrid License: MIT. |
(function (exports, global) {
if (typeof define === "function" && define.amd) {
define(exports);
} else if (typeof module !== "undefined" && module.exports) {
module.exports = exports;
} else {
global.ux = exports;
}
!function(a,b){"function"==typeof define&&define.amd?define(a):"undefined"!=typeof module&&module.exports?module.exports=a:b.ux=a,angular.module("ux").factory("iScrollAddon",function(){return["inst",function(b){function c(){var a={mouseWheel:!0,scrollbars:!0,bounce:!0,bindToWrapper:!0,tap:!0,interactiveScrollbars:!0,deceleration:.005,click:!0,startY:-(b.scrollHistory&&b.scrollHistory.getCurrentScroll()||b.values.scroll||0)};m||(b.element[0].style.overflowY="hidden",q.log("IScroll Init at startY %s",a.startY),m=new IScroll(b.element[0],a),m.on("beforeScrollStart",f),m.on("scrollStart",f),m.on("scrollEnd",g)),m._initEvents(!0),m.scroller=b.getContent()[0],m.scrollerStyle=m.scroller.style,m._initEvents(),m.scrollTo(0,a.startY),q.iScroll=m,d()}function d(){i(),n=setInterval(j,100)}function e(){clearTimeout(l)}function f(){e(),r=!0,b.dispatch(a.datagrid.events.ON_SCROLL_START,-m.y)}function g(){e(),l=setTimeout(h,b.options.updateDelay)}function h(){b.values.scroll=-m.y,s.onScrollingStop(),r=!1}function i(){clearInterval(n)}function j(){var a;b.element?(a=b.element[0].offsetHeight)&&(i(),q.log(" refresh iscroll height:%s/%s",a,b.getContentHeight()),m.refresh()):i()}function k(a,c){var d=void 0!==c?-c:m.y;r&&d!==t&&(b.values.speed=d-t,b.values.absSpeed=Math.abs(b.values.speed),q.setScroll(-d),t=d,b.values.scrollPercent=(b.values.scroll/b.getContentHeight()*100).toFixed(2),q.fireOnScroll())}if(a.datagrid.isIOS){IScroll||b.throwError("IScroll (https://github.com/cubiq/iscroll) is required to use the iScrollAddon.");var l,m,n,o,p,q=a.logWrapper("iScrollAddon",{},"purple",b),r=!1,s=b.scrollModel,t=0;return p=b.scope.$on(a.datagrid.events.ON_READY,function(){s.removeScrollListener(),p()}),b.unwatchers.push(b.scope.$on(a.datagrid.events.ON_AFTER_HEIGHTS_UPDATED_RENDER,c)),q.getScroll=function(){return m&&m.y||0},q.setScroll=function(a){q.log("setScroll %s",a),b.values.scroll=a},q.waitForStop=s.waitForStop,q.scrollTo=function(a,d){q.log("scrollTo %s",a),b.element[0].scrollTop&&(b.element[0].scrollTop=0),m||c(),a=s.capScrollValue(a),m.scrollTo(0,-a,d?0:200),clearTimeout(o),d?(b.values.scroll||a)&&(r=!0,q.onUpdateScroll(null,a),r=!1,q.onScrollingStop()):o=setTimeout(function(){q.onScrollingStop()},200)},q.scrollToIndex=s.scrollToIndex,q.scrollToItem=s.scrollToItem,q.scrollIntoView=s.scrollIntoView,q.scrollToBottom=function(a){var c=b.getContentHeight()-b.getViewportHeight();m.scrollTo(0,-c,a?0:200)},q.onScrollingStop=s.onScrollingStop,q.onUpdateScroll=k,q.fireOnScroll=s.fireOnScroll,b.unwatchers.push(b.scope.$on(a.datagrid.events.ON_AFTER_HEIGHTS_UPDATED_RENDER,function(){b.element[0].scrollTop=0,m&&j()})),q.destroy=function(){p(),clearTimeout(o),e(),s.destroy(),m&&m.destroy()},b.scrollModel=q,q}}]})}(this.ux=this.ux||{},function(){return this}());
|
¶ sourceMappingURL=ux-datagrid-iscroll.min.js.map |
}(this.ux = this.ux || {}, function() {return this;}()));
|