/*
* Kendo UI Complete v2013.3.1119 (http://kendoui.com)
* Copyright 2013 Telerik AD. All rights reserved.
*
* Kendo UI Complete commercial licenses may be obtained at
* https://www.kendoui.com/purchase/license-agreement/kendo-ui-complete-commercial.aspx
* If you do not own a commercial license, this file shall be governed by the trial license terms.
*/
!function(define){return define(["./kendo.data.min"],function(){!function(e,t){function a(e,t,a,n){return e({idx:t,text:a,ns:p.ns,numeric:n})}function n(e,t,a){return b({className:e.substring(1),text:t,wrapClassName:a||""})}function s(e,t,a,n){e.find(t).parent().attr(p.attr("page"),a).attr("tabindex",-1).toggleClass("k-state-disabled",n)}function i(e,t){s(e,m,1,1>=t)}function r(e,t){s(e,c,Math.max(1,t-1),1>=t)}function l(e,t,a){s(e,h,Math.min(a,t+1),t>=a)}function o(e,t,a){s(e,u,a,t>=a)}var p=window.kendo,d=p.ui,f=d.Widget,g=e.proxy,m=".k-i-seek-w",u=".k-i-seek-e",c=".k-i-arrow-w",h=".k-i-arrow-e",k="change",S=".kendoPager",x="click",v="keydown",w="disabled",b=p.template('#=text#'),y=f.extend({init:function(t,a){var s,d,w=this;f.fn.init.call(w,t,a),a=w.options,w.dataSource=p.data.DataSource.create(a.dataSource),w.linkTemplate=p.template(w.options.linkTemplate),w.selectTemplate=p.template(w.options.selectTemplate),s=w.page(),d=w.totalPages(),w._refreshHandler=g(w.refresh,w),w.dataSource.bind(k,w._refreshHandler),a.previousNext&&(w.element.find(m).length||(w.element.append(n(m,a.messages.first,"k-pager-first")),i(w.element,s,d)),w.element.find(c).length||(w.element.append(n(c,a.messages.previous)),r(w.element,s,d))),a.numeric&&(w.list=w.element.find(".k-pager-numbers"),w.list.length||(w.list=e('
',buttonCount:10,autoBind:!0,numeric:!0,info:!0,input:!1,previousNext:!0,pageSizes:!1,refresh:!1,messages:{display:"{0} - {1} of {2} items",empty:"No items to display",page:"Page",of:"of {0}",itemsPerPage:"items per page",first:"Go to the first page",previous:"Go to the previous page",next:"Go to the next page",last:"Go to the last page",refresh:"Refresh"}},setDataSource:function(e){var t=this;t.dataSource.unbind(k,t._refreshHandler),t.dataSource=t.options.dataSource=e,e.bind(k,t._refreshHandler),t.options.autoBind&&e.fetch()},refresh:function(e){var t,n,s,d=this,f=1,g="",m=d.page(),u=d.options,c=d.pageSize(),h=d.dataSource.total(),k=d.totalPages(),S=d.linkTemplate,x=u.buttonCount;if(!e||"itemchange"!=e.action){if(u.numeric){for(m>x&&(s=m%x,f=0===s?m-x+1:m-s+1),n=Math.min(f+x-1,k),f>1&&(g+=a(S,f-1,"...",!1)),t=f;n>=t;t++)g+=a(t==m?d.selectTemplate:S,t,t,!0);k>n&&(g+=a(S,t,"...",!1)),""===g&&(g=d.selectTemplate({text:0})),d.list.html(g)}u.info&&(g=h>0?p.format(u.messages.display,(m-1)*c+1,Math.min(m*c,h),h):u.messages.empty,d.element.find(".k-pager-info").html(g)),u.input&&d.element.find(".k-pager-input").html(d.options.messages.page+''+p.format(u.messages.of,k)).find("input").val(m).attr(w,1>h).toggleClass("k-state-disabled",1>h),u.previousNext&&(i(d.element,m,k),r(d.element,m,k),l(d.element,m,k),o(d.element,m,k)),u.pageSizes&&d.element.find(".k-pager-sizes select").val(c).filter("["+p.attr("role")+"=dropdownlist]").kendoDropDownList("value",c).kendoDropDownList("text",c)}},_keydown:function(e){if(e.keyCode===p.keys.ENTER){var t=this.element.find(".k-pager-input").find("input"),a=parseInt(t.val(),10);(isNaN(a)||1>a||a>this.totalPages())&&(a=this.page()),t.val(a),this.page(a)}},_refreshClick:function(e){e.preventDefault(),this.dataSource.read()},_change:function(e){var t=parseInt(e.currentTarget.value,10);isNaN(t)||this.dataSource.pageSize(t)},_click:function(t){var a=e(t.currentTarget);t.preventDefault(),a.is(".k-state-disabled")||this.page(a.attr(p.attr("page")))},totalPages:function(){return Math.ceil((this.dataSource.total()||0)/this.pageSize())},pageSize:function(){return this.dataSource.pageSize()||this.dataSource.total()},page:function(e){return e===t?this.dataSource.total()>0?this.dataSource.page():0:(this.dataSource.page(e),this.trigger(k,{index:e}),t)}});d.plugin(y)}(window.kendo.jQuery)})}("function"==typeof define&&define.amd?define:function(e,t){return t()});
//@ sourceMappingURL=kendo.pager.min.js.map