/* YUI 3.17.2 (build 9c3c78e) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add("datatable-paginator",function(e,t){function f(){}var n,r,i=e.DataTable.Templates.Paginator,s=e.Lang.sub,o=e.ClassNameManager.getClassName,u=o(t,"control-disabled"),a="paginator:ui";n=e.Base.create("dt-pg-model",e.Model,[e.Paginator.Core]),r=e.Base.create("dt-pg-view",e.View,[],{_eventHandles:[],containerTemplate:'
',contentTemplate:"{buttons}{goto}{perPage}",_allowAdHocAttrs:!1,initializer:function(){this.containerTemplate=s(this.containerTemplate,{paginator:o(t)}),this._initStrings(),this._initClassNames(),this.attachEvents()},render:function(){var e=this.get("model"),t=s(this.contentTemplate,{buttons:this._buildButtonsGroup(),"goto":this._buildGotoGroup(),perPage:this._buildPerPageGroup()});return this.get("container").append(t),this.attachEvents(),this._rendered=!0,this._updateControlsUI(e.get("page")),this._updateItemsPerPageUI(e.get("itemsPerPage")),this},attachEvents:function(){r.superclass.attachEvents.apply(this,arguments);var t=this.get("container");this.classNames||this._initClassNames(),this._attachedViewEvents.push(t.delegate("click",this._controlClick,"."+this.classNames.control,this),this.get("model").after("change",this._modelChange,this)),t.all("form").each(e.bind(function(e){this._attachedViewEvents.push(e.after("submit",this._controlSubmit,this))},this)),t.all("select").each(e.bind(function(e){this._attachedViewEvents.push(e.after("change",this._controlChange,this))},this))},_buildButtonsGroup:function(){var e=this.get("strings"),t=this.classNames,n;return n=i.button({type:"first",label:e.first,classNames:t})+i.button({type:"prev",label:e.prev,classNames:t})+i.button({type:"next",label:e.next,classNames:t})+i.button({type:"last",label:e.last,classNames:t}),i.buttons({classNames:t,buttons:n})},_buildGotoGroup:function(){return i.gotoPage({classNames:this.classNames,strings:this.get("strings"),page:this.get("model").get("page")})},_buildPerPageGroup:function(){var e=this.get("pageSizes"),t=this.get("model").get("rowsPerPage"),n,r,s;for(s=0,r=e.length;s