kendo.toolbar.min.js
24.9 KB
/**
* Kendo UI v2016.1.112 (http://www.telerik.com/kendo-ui)
* Copyright 2016 Telerik AD. All rights reserved.
*
* Kendo UI commercial licenses may be obtained at
* http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
* If you do not own a commercial license, this file shall be governed by the trial license terms.
*/
!function(t,define){define("kendo.toolbar.min",["kendo.core.min","kendo.userevents.min","kendo.popup.min"],t)}(function(){return function(t,e){function o(){var t,e=this.options.anchor,o=e.outerWidth();_.wrap(this.element).addClass("k-split-wrapper"),t="border-box"!==this.element.css("box-sizing")?o-(this.element.outerWidth()-this.element.width()):o,this.element.css({fontFamily:e.css("font-family"),"min-width":t})}function i(t){t.target.is(".k-toggle-button")||t.target.toggleClass(R,"press"==t.type)}function n(e){return e=t(e),e.hasClass("km-actionsheet")?e.closest(".km-popup-wrapper"):e.addClass("km-widget km-actionsheet").wrap('<div class="km-actionsheet-wrapper km-actionsheet-tablet km-widget km-popup"></div>').parent().wrap('<div class="km-popup-wrapper k-popup"></div>').parent()}function s(t){t.preventDefault()}function l(e,o){var i="next"===o?t.fn.next:t.fn.prev,n="next"===o?t.fn.first:t.fn.last,s=i.call(e);return s.is(":kendoFocusable")||!s.length?s:s.find(":kendoFocusable").length?n.call(s.find(":kendoFocusable")):l(s,o)}var a,r,d,p,h,u,c,f,m,b,v,g,w,k,C,y,_=window.kendo,A=_.Class,x=_.ui.Widget,B=t.proxy,T=_.isFunction,O=_.keys,E="k-toolbar",I="k-button",U="k-overflow-button",z="k-toggle-button",P="k-button-group",G="k-split-button",W="k-separator",H="k-popup",D="k-toolbar-resizable",R="k-state-active",F="k-state-disabled",M="k-state-hidden",S="k-group-start",N="k-group-end",K="k-primary",j="k-icon",Q="k-i-",V="k-button-icon",q="k-button-icontext",J="k-list-container k-split-container",L="k-split-button-arrow",X="k-overflow-anchor",Y="k-overflow-container",Z="k-toolbar-first-visible",$="k-toolbar-last-visible",tt="click",et="toggle",ot="open",it="close",nt="overflowOpen",st="overflowClose",lt="never",at="auto",rt="always",dt="k-overflow-hidden",pt=_.attr("uid");_.toolbar={},a={overflowAnchor:'<div tabindex="0" class="k-overflow-anchor"></div>',overflowContainer:'<ul class="k-overflow-container k-list-container"></ul>'},_.toolbar.registerComponent=function(t,e,o){a[t]={toolbar:e,overflow:o}},r=_.Class.extend({addOverflowAttr:function(){this.element.attr(_.attr("overflow"),this.options.overflow||at)},addUidAttr:function(){this.element.attr(pt,this.options.uid)},addIdAttr:function(){this.options.id&&this.element.attr("id",this.options.id)},addOverflowIdAttr:function(){this.options.id&&this.element.attr("id",this.options.id+"_overflow")},attributes:function(){this.options.attributes&&this.element.attr(this.options.attributes)},show:function(){this.element.removeClass(M).show(),this.options.hidden=!1},hide:function(){this.element.addClass(M).hide(),this.options.hidden=!0},remove:function(){this.element.remove()},enable:function(t){t===e&&(t=!0),this.element.toggleClass(F,!t),this.options.enable=t},twin:function(){var t=this.element.attr(pt);return this.overflow?this.toolbar.element.find("["+pt+"='"+t+"']").data(this.options.type):this.toolbar.options.resizable?this.toolbar.popup.element.find("["+pt+"='"+t+"']").data(this.options.type):e}}),_.toolbar.Item=r,d=r.extend({init:function(o,i){var n=t(o.useButtonTag?'<button tabindex="0"></button>':'<a href tabindex="0"></a>');this.element=n,this.options=o,this.toolbar=i,this.attributes(),o.primary&&n.addClass(K),o.togglable&&(n.addClass(z),this.toggle(o.selected)),o.url===e||o.useButtonTag||(n.attr("href",o.url),o.mobile&&n.attr(_.attr("role"),"button")),o.group&&(n.attr(_.attr("group"),o.group),this.group=this.toolbar.addToGroup(this,o.group)),!o.togglable&&o.click&&T(o.click)&&(this.clickHandler=o.click),o.togglable&&o.toggle&&T(o.toggle)&&(this.toggleHandler=o.toggle)},toggle:function(t,e){t=!!t,this.group&&t?this.group.select(this):this.group||this.select(t),e&&this.twin()&&this.twin().toggle(t)},getParentGroup:function(){return this.options.isChild?this.element.closest("."+P).data("buttonGroup"):e},_addGraphics:function(){var e,o,i,n=this.element,s=this.options.icon,l=this.options.spriteCssClass,a=this.options.imageUrl;(l||a||s)&&(e=!0,n.contents().not("span.k-sprite,span."+j+",img.k-image").each(function(o,i){(1==i.nodeType||3==i.nodeType&&t.trim(i.nodeValue).length>0)&&(e=!1)}),n.addClass(e?V:q)),s?(o=n.children("span."+j).first(),o[0]||(o=t('<span class="'+j+'"></span>').prependTo(n)),o.addClass(Q+s)):l?(o=n.children("span.k-sprite").first(),o[0]||(o=t('<span class="k-sprite"></span>').prependTo(n)),o.addClass(l)):a&&(i=n.children("img.k-image").first(),i[0]||(i=t('<img alt="icon" class="k-image" />').prependTo(n)),i.attr("src",a))}}),_.toolbar.Button=d,p=d.extend({init:function(t,e){d.fn.init.call(this,t,e);var o=this.element;o.addClass(I),this.addIdAttr(),t.align&&o.addClass("k-align-"+t.align),"overflow"!=t.showText&&t.text&&o.html(t.mobile?'<span class="km-text">'+t.text+"</span>":t.text),t.hasIcon="overflow"!=t.showIcon&&(t.icon||t.spriteCssClass||t.imageUrl),t.hasIcon&&this._addGraphics(),this.addUidAttr(),this.addOverflowAttr(),this.enable(t.enable),t.hidden&&this.hide(),this.element.data({type:"button",button:this})},select:function(t){t===e&&(t=!1),this.element.toggleClass(R,t),this.options.selected=t}}),_.toolbar.ToolBarButton=p,h=d.extend({init:function(t,e){this.overflow=!0,d.fn.init.call(this,t,e);var o=this.element;"toolbar"!=t.showText&&t.text&&o.html(t.mobile?'<span class="km-text">'+t.text+"</span>":'<span class="k-text">'+t.text+"</span>"),t.hasIcon="toolbar"!=t.showIcon&&(t.icon||t.spriteCssClass||t.imageUrl),t.hasIcon&&this._addGraphics(),t.isChild||this._wrap(),this.addOverflowIdAttr(),this.attributes(),this.addUidAttr(),this.addOverflowAttr(),this.enable(t.enable),o.addClass(U+" "+I),t.hidden&&this.hide(),this.element.data({type:"button",button:this})},_wrap:function(){this.element=this.element.wrap("<li></li>").parent()},overflowHidden:function(){this.element.addClass(dt)},select:function(t){t===e&&(t=!1),this.options.isChild?this.element.toggleClass(R,t):this.element.find(".k-button").toggleClass(R,t),this.options.selected=t}}),_.toolbar.OverflowButton=h,_.toolbar.registerComponent("button",p,h),u=r.extend({createButtons:function(e){var o,i,n=this.options,s=n.buttons||[];for(i=0;s.length>i;i++)s[i].uid||(s[i].uid=_.guid()),o=new e(t.extend({mobile:n.mobile,isChild:!0,type:"button"},s[i]),this.toolbar),o.element.appendTo(this.element)},refresh:function(){this.element.children().filter(":not('."+M+"'):first").addClass(S),this.element.children().filter(":not('."+M+"'):last").addClass(N)}}),_.toolbar.ButtonGroup=u,c=u.extend({init:function(e,o){var i=this.element=t("<div></div>");this.options=e,this.toolbar=o,this.addIdAttr(),e.align&&i.addClass("k-align-"+e.align),this.createButtons(p),this.attributes(),this.addUidAttr(),this.addOverflowAttr(),this.refresh(),i.addClass(P),this.element.data({type:"buttonGroup",buttonGroup:this})}}),_.toolbar.ToolBarButtonGroup=c,f=u.extend({init:function(e,o){var i=this.element=t("<li></li>");this.options=e,this.toolbar=o,this.overflow=!0,this.addOverflowIdAttr(),this.createButtons(h),this.attributes(),this.addUidAttr(),this.addOverflowAttr(),this.refresh(),i.addClass((e.mobile?"":P)+" k-overflow-group"),this.element.data({type:"buttonGroup",buttonGroup:this})},overflowHidden:function(){this.element.addClass(dt)}}),_.toolbar.OverflowButtonGroup=f,_.toolbar.registerComponent("buttonGroup",c,f),m=r.extend({init:function(e,o){var i=this.element=t('<div class="'+G+'" tabindex="0"></div>');this.options=e,this.toolbar=o,this.mainButton=new p(e,o),this.arrowButton=t('<a class="'+I+" "+L+'"><span class="'+(e.mobile?"km-icon km-arrowdown":"k-icon k-i-arrow-s")+'"></span></a>'),this.popupElement=t('<ul class="'+J+'"></ul>'),this.mainButton.element.removeAttr("href tabindex").appendTo(i),this.arrowButton.appendTo(i),this.popupElement.appendTo(i),e.align&&i.addClass("k-align-"+e.align),e.id||(e.id=e.uid),i.attr("id",e.id+"_wrapper"),this.addOverflowAttr(),this.addUidAttr(),this.createMenuButtons(),this.createPopup(),this._navigatable(),this.mainButton.main=!0,i.data({type:"splitButton",splitButton:this,kendoPopup:this.popup})},_navigatable:function(){var e=this;e.popupElement.on("keydown","."+I,function(o){var i=t(o.target).parent();o.preventDefault(),o.keyCode===O.ESC||o.keyCode===O.TAB||o.altKey&&o.keyCode===O.UP?(e.toggle(),e.focus()):o.keyCode===O.DOWN?l(i,"next").focus():o.keyCode===O.UP?l(i,"prev").focus():(o.keyCode===O.SPACEBAR||o.keyCode===O.ENTER)&&e.toolbar.userEvents.trigger("tap",{target:t(o.target)})})},createMenuButtons:function(){var e,o,i=this.options,n=i.menuButtons;for(o=0;n.length>o;o++)e=new p(t.extend({mobile:i.mobile,type:"button",click:i.click},n[o]),this.toolbar),e.element.wrap("<li></li>").parent().appendTo(this.popupElement)},createPopup:function(){var e=this.options,i=this.element;this.popupElement.attr("id",e.id+"_optionlist").attr(pt,e.rootUid),e.mobile&&(this.popupElement=n(this.popupElement)),this.popup=this.popupElement.kendoPopup({appendTo:e.mobile?t(e.mobile).children(".km-pane"):null,anchor:i,isRtl:this.toolbar._isRtl,copyAnchorStyles:!1,animation:e.animation,open:o,activate:function(){this.element.find(":kendoFocusable").first().focus()},close:function(){i.focus()}}).data("kendoPopup"),this.popup.element.on(tt,"a.k-button",s)},remove:function(){this.popup.element.off(tt,"a.k-button"),this.popup.destroy(),this.element.remove()},toggle:function(){this.popup.toggle()},enable:function(t){t===e&&(t=!0),this.mainButton.enable(t),this.options.enable=t},focus:function(){this.element.focus()}}),_.toolbar.ToolBarSplitButton=m,b=r.extend({init:function(e,o){var i,n,s=this.element=t('<li class="'+G+'"></li>'),l=e.menuButtons;for(this.options=e,this.toolbar=o,this.overflow=!0,this.mainButton=new h(t.extend({isChild:!0},e)),this.mainButton.element.appendTo(s),n=0;l.length>n;n++)i=new h(t.extend({mobile:e.mobile,isChild:!0},l[n]),this.toolbar),i.element.appendTo(s);this.addUidAttr(),this.addOverflowAttr(),this.mainButton.main=!0,s.data({type:"splitButton",splitButton:this})},overflowHidden:function(){this.element.addClass(dt)}}),_.toolbar.OverflowSplitButton=b,_.toolbar.registerComponent("splitButton",m,b),v=r.extend({init:function(e,o){var i=this.element=t("<div> </div>");this.element=i,this.options=e,this.toolbar=o,this.attributes(),this.addIdAttr(),this.addUidAttr(),this.addOverflowAttr(),i.addClass(W),i.data({type:"separator",separator:this})}}),g=r.extend({init:function(e,o){var i=this.element=t("<li> </li>");this.element=i,this.options=e,this.toolbar=o,this.overflow=!0,this.attributes(),this.addUidAttr(),this.addOverflowIdAttr(),i.addClass(W),i.data({type:"separator",separator:this})},overflowHidden:function(){this.element.addClass(dt)}}),_.toolbar.registerComponent("separator",v,g),w=r.extend({init:function(e,o,i){var n=T(e)?e(o):e;n=n instanceof jQuery?n.wrap("<div></div>").parent():t("<div></div>").html(n),this.element=n,this.options=o,this.options.type="template",this.toolbar=i,this.attributes(),this.addUidAttr(),this.addIdAttr(),this.addOverflowAttr(),n.data({type:"template",template:this})}}),_.toolbar.TemplateItem=w,k=r.extend({init:function(e,o,i){var n=t(T(e)?e(o):e);n=n instanceof jQuery?n.wrap("<li></li>").parent():t("<li></li>").html(n),this.element=n,this.options=o,this.options.type="template",this.toolbar=i,this.overflow=!0,this.attributes(),this.addUidAttr(),this.addOverflowIdAttr(),this.addOverflowAttr(),n.data({type:"template",template:this})},overflowHidden:function(){this.element.addClass(dt)}}),_.toolbar.OverflowTemplateItem=k,C=A.extend({init:function(t){this.name=t,this.buttons=[]},add:function(t){this.buttons[this.buttons.length]=t},remove:function(e){var o=t.inArray(e,this.buttons);this.buttons.splice(o,1)},select:function(t){var e,o;for(o=0;this.buttons.length>o;o++)e=this.buttons[o],e.select(!1);t.select(!0),t.twin()&&t.twin().select(!0)}}),y=x.extend({init:function(e,o){var n,l=this;if(x.fn.init.call(l,e,o),o=l.options,e=l.wrapper=l.element,e.addClass(E+" k-widget"),this.uid=_.guid(),this._isRtl=_.support.isRtl(e),this._groups={},e.attr(pt,this.uid),l.isMobile="boolean"==typeof o.mobile?o.mobile:l.element.closest(".km-root")[0],l.animation=l.isMobile?{open:{effects:"fade"}}:{},l.isMobile&&(e.addClass("km-widget"),j="km-icon",Q="km-",I="km-button",P="km-buttongroup km-widget",R="km-state-active",F="km-state-disabled"),o.resizable?(l._renderOverflow(),e.addClass(D),l.overflowUserEvents=new _.UserEvents(l.element,{threshold:5,allowSelection:!0,filter:"."+X,tap:B(l._toggleOverflow,l)}),l._resizeHandler=_.onResize(function(){l.resize()})):l.popup={element:t([])},o.items&&o.items.length)for(n=0;o.items.length>n;n++)l.add(o.items[n]);l.userEvents=new _.UserEvents(document,{threshold:5,allowSelection:!0,filter:"["+pt+"="+this.uid+"] a."+I+", ["+pt+"="+this.uid+"] ."+U,tap:B(l._buttonClick,l),press:i,release:i}),l.element.on(tt,"a.k-button",s),l._navigatable(),o.resizable&&l.popup.element.on(tt,NaN,s),o.resizable&&this._toggleOverflowAnchor(),_.notify(l)},events:[tt,et,ot,it,nt,st],options:{name:"ToolBar",items:[],resizable:!0,mobile:null},addToGroup:function(t,e){var o;return o=this._groups[e]?this._groups[e]:this._groups[e]=new C,o.add(t),o},destroy:function(){var e=this;e.element.find("."+G).each(function(e,o){t(o).data("kendoPopup").destroy()}),e.element.off(tt,"a.k-button"),e.userEvents.destroy(),e.options.resizable&&(_.unbindResize(e._resizeHandler),e.overflowUserEvents.destroy(),e.popup.element.off(tt,"a.k-button"),e.popup.destroy()),x.fn.destroy.call(e)},add:function(e){var o,i,n,s=a[e.type],l=e.template,r=this,d=r.isMobile?"":"k-item k-state-default",p=e.overflowTemplate;if(t.extend(e,{uid:_.guid(),animation:r.animation,mobile:r.isMobile,rootUid:r.uid}),e.menuButtons)for(n=0;e.menuButtons.length>n;n++)t.extend(e.menuButtons[n],{uid:_.guid()});l&&!p?e.overflow=lt:e.overflow||(e.overflow=at),e.overflow!==lt&&r.options.resizable&&(p?i=new k(p,e,r):s&&(i=new s.overflow(e,r),i.element.addClass(d)),i&&(e.overflow===at&&i.overflowHidden(),i.element.appendTo(r.popup.container),r.angular("compile",function(){return{elements:i.element.get()}}))),e.overflow!==rt&&(l?o=new w(l,e,r):s&&(o=new s.toolbar(e,r)),o&&(r.options.resizable?(o.element.appendTo(r.element).css("visibility","hidden"),r._shrink(r.element.innerWidth()),o.element.css("visibility","visible")):o.element.appendTo(r.element),r.angular("compile",function(){return{elements:o.element.get()}})))},_getItem:function(e){var o,i,n,s,l=this.options.resizable;return o=this.element.find(e),o.length||(o=t(".k-split-container[data-uid="+this.uid+"]").find(e)),s=o.length?o.data("type"):"",i=o.data(s),i?(i.main&&(o=o.parent("."+G),s="splitButton",i=o.data(s)),l&&(n=i.twin())):l&&(o=this.popup.element.find(e),s=o.length?o.data("type"):"",n=o.data(s),n&&n.main&&(o=o.parent("."+G),s="splitButton",n=o.data(s))),{type:s,toolbar:i,overflow:n}},remove:function(t){var e=this._getItem(t);e.toolbar&&e.toolbar.remove(),e.overflow&&e.overflow.remove(),this.resize(!0)},hide:function(t){var e=this._getItem(t);e.toolbar&&(e.toolbar.hide(),"button"===e.toolbar.options.type&&e.toolbar.options.isChild&&e.toolbar.getParentGroup().refresh()),e.overflow&&(e.overflow.hide(),"button"===e.overflow.options.type&&e.overflow.options.isChild&&e.overflow.getParentGroup().refresh()),this.resize(!0)},show:function(t){var e=this._getItem(t);e.toolbar?(e.toolbar.show(),"button"===e.toolbar.options.type&&e.toolbar.options.isChild&&e.toolbar.getParentGroup().refresh()):e.overflow&&(e.overflow.show(),"button"===e.overflow.options.type&&e.overflow.options.isChild&&e.overflow.getParentGroup().refresh()),this.resize(!0)},enable:function(t,o){var i=this._getItem(t);e===o&&(o=!0),i.toolbar&&i.toolbar.enable(o),i.overflow&&i.overflow.enable(o)},getSelectedFromGroup:function(t){return this.element.find("."+z+"[data-group='"+t+"']").filter("."+R)},toggle:function(o,i){var n=t(o),s=n.data("button");s.options.togglable&&(i===e&&(i=!0),s.toggle(i,!0))},_renderOverflow:function(){var e=this,o=a.overflowContainer,i=e._isRtl,s=i?"left":"right";e.overflowAnchor=t(a.overflowAnchor).addClass(I),e.element.append(e.overflowAnchor),e.isMobile?(e.overflowAnchor.append('<span class="km-icon km-more"></span>'),o=n(o)):e.overflowAnchor.append('<span class="k-icon k-i-arrow-s"></span>'),e.popup=new _.ui.Popup(o,{origin:"bottom "+s,position:"top "+s,anchor:e.overflowAnchor,isRtl:i,animation:e.animation,appendTo:e.isMobile?t(e.isMobile).children(".km-pane"):null,copyAnchorStyles:!1,open:function(o){var n=_.wrap(e.popup.element).addClass("k-overflow-wrapper");e.isMobile?e.popup.container.css("max-height",parseFloat(t(".km-content:visible").innerHeight())-15+"px"):n.css("margin-left",(i?-1:1)*((n.outerWidth()-n.width())/2+1)),e.trigger(nt)&&o.preventDefault()},activate:function(){this.element.find(":kendoFocusable").first().focus()},close:function(t){e.trigger(st)&&t.preventDefault(),this.element.focus()}}),e.popup.element.on("keydown","."+I,function(o){var i,n=t(o.target),s=n.parent(),a=s.is("."+P)||s.is("."+G);o.preventDefault(),o.keyCode===O.ESC||o.keyCode===O.TAB||o.altKey&&o.keyCode===O.UP?(e._toggleOverflow(),e.overflowAnchor.focus()):o.keyCode===O.DOWN?(i=!a||a&&n.is(":last-child")?s:n,l(i,"next").focus()):o.keyCode===O.UP?(i=!a||a&&n.is(":first-child")?s:n,l(i,"prev").focus()):(o.keyCode===O.SPACEBAR||o.keyCode===O.ENTER)&&e.userEvents.trigger("tap",{target:t(o.target)})}),e.popup.container=e.isMobile?e.popup.element.find("."+Y):e.popup.element,e.popup.container.attr(pt,this.uid)},_toggleOverflowAnchor:function(){this.overflowAnchor.css(this.popup.element.children(":not(."+dt+", ."+H+")").length>0?{visibility:"visible",width:""}:{visibility:"hidden",width:"1px"})},_buttonClick:function(o){var i,n,s,l,a,r,d=this,p=o.target.closest("."+L).length;return o.preventDefault(),p?(d._toggle(o),e):(n=t(o.target).closest("."+I,d.element),n.hasClass(X)||(s=n.data("button"),!s&&d.popup&&(n=t(o.target).closest("."+U,d.popup.container),s=n.parent("li").data("button")),s&&s.options.enable&&(s.options.togglable?(a=T(s.toggleHandler)?s.toggleHandler:null,s.toggle(!s.options.selected,!0),r={target:n,group:s.options.group,checked:s.options.selected,id:s.options.id},a&&a.call(d,r),d.trigger(et,r)):(a=T(s.clickHandler)?s.clickHandler:null,r={sender:d,target:n,id:s.options.id},a&&a.call(d,r),d.trigger(tt,r)),s.options.url&&(window.location.href=s.options.url),n.hasClass(U)&&d.popup.close(),l=n.closest(".k-split-container"),l[0]&&(i=l.data("kendoPopup"),(i?i:l.parents(".km-popup-wrapper").data("kendoPopup")).close()))),e)},_navigatable:function(){var e=this;e.element.attr("tabindex",0).focus(function(){var e=t(this).find(":kendoFocusable:first");e.is("."+X)&&(e=l(e,"next")),e[0].focus()}).on("keydown",B(e._keydown,e))},_keydown:function(o){var i,n,s,l,a,r=t(o.target),d=o.keyCode,p=this.element.children(":not(.k-separator):visible");return d===O.TAB&&(i=r.parentsUntil(this.element).last(),n=!1,s=!1,i.length||(i=r),i.is("."+X)&&(o.shiftKey&&o.preventDefault(),p.last().is(":kendoFocusable")?p.last().focus():p.last().find(":kendoFocusable").last().focus()),o.shiftKey||p.index(i)!==p.length-1||(n=i.is("."+P)?r.is(":last-child"):!0),o.shiftKey&&1===p.index(i)&&(s=i.is("."+P)?r.is(":first-child"):!0),n&&"hidden"!==this.overflowAnchor.css("visibility")&&(o.preventDefault(),this.overflowAnchor.focus()),s&&(o.preventDefault(),this.wrapper.prev(":kendoFocusable").focus())),o.altKey&&d===O.DOWN?(l=t(document.activeElement).data("splitButton"),a=t(document.activeElement).is("."+X),l?l.toggle():a&&this._toggleOverflow(),e):d!==O.SPACEBAR&&d!==O.ENTER||r.is("input, checkbox")?e:(o.preventDefault(),r.is("."+G)&&(r=r.children().first()),this.userEvents.trigger("tap",{target:r}),e)},_toggle:function(e){var o,i=t(e.target).closest("."+G).data("splitButton");e.preventDefault(),i.options.enable&&(o=i.popup.element.is(":visible")?this.trigger(it,{target:i.element}):this.trigger(ot,{target:i.element}),o||i.toggle())},_toggleOverflow:function(){this.popup.toggle()},_resize:function(t){var e=t.width;this.options.resizable&&(this.popup.close(),this._shrink(e),this._stretch(e),this._markVisibles(),this._toggleOverflowAnchor())},_childrenWidth:function(){var e=0;return this.element.children(":visible:not('."+M+"')").each(function(){e+=t(this).outerWidth(!0)}),Math.ceil(e)},_shrink:function(t){var e,o,i;if(t<this._childrenWidth())for(o=this.element.children(":visible:not([data-overflow='never'], ."+X+")"),i=o.length-1;i>=0&&(e=o.eq(i),!(t>this._childrenWidth()));i--)this._hideItem(e)},_stretch:function(t){var e,o,i;if(t>this._childrenWidth())for(o=this.element.children(":hidden:not('."+M+"')"),i=0;o.length>i&&(e=o.eq(i),!(t<this._childrenWidth())&&this._showItem(e,t));i++);},_hideItem:function(t){t.hide(),this.popup&&this.popup.container.find(">li[data-uid='"+t.data("uid")+"']").removeClass(dt)},_showItem:function(t,e){return t.length&&e>this._childrenWidth()+t.outerWidth(!0)?(t.show(),this.popup&&this.popup.container.find(">li[data-uid='"+t.data("uid")+"']").addClass(dt),!0):!1},_markVisibles:function(){var t=this.popup.container.children(),e=this.element.children(":not(.k-overflow-anchor)"),o=t.filter(":not(.k-overflow-hidden)"),i=e.filter(":visible");t.add(e).removeClass(Z+" "+$),o.first().add(i.first()).addClass(Z),o.last().add(i.last()).addClass($)}}),_.ui.plugin(y)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(t,e,o){(o||e)()});
//# sourceMappingURL=kendo.toolbar.min.js.map