16 lines
12 KiB
JavaScript
16 lines
12 KiB
JavaScript
|
/**
|
||
|
* Copyright 2014 Telerik AD
|
||
|
*
|
||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/
|
||
|
!function(e,define){define(["./kendo.core.min"],e)}(function(){return function(e,t){function n(n){var i=e(n.useButtonTag?"<button></button>":"<a></a>");return i.data({type:"button"}),i.attr(j,n.uid),n.togglable&&(i.addClass(g),n.selected&&i.addClass(b)),n.enable===!1&&i.addClass(w),n.url===t||n.useButtonTag||(i.attr("href",n.url),n.mobile&&i.attr(d.attr("role"),"button")),n.group&&i.attr(d.attr("group"),n.group),!n.togglable&&n.click&&p(n.click)&&i.data("click",n.click),n.togglable&&n.toggle&&p(n.toggle)&&i.data("toggle",n.toggle),i}function i(e){var t,n=G.button.base(e);return n.addClass(h),e.primary&&n.addClass(C),e.align&&n.addClass("k-align-"+e.align),e.id&&n.attr("id",e.id),"overflow"!=e.showText&&e.text&&(e.mobile?n.html('<span class="km-text">'+e.text+"</span>"):n.text(e.text)),t="overflow"!=e.showIcon&&(e.icon||e.spriteCssClass||e.imageUrl),t&&o(e,n),n}function r(e){var t,n=G.button.base(e);return n.addClass(m+" "+h),e.primary&&n.addClass(C),e.id&&n.attr("id",e.id+"_overflow"),"toolbar"!=e.showText&&e.text&&(e.mobile?n.html('<span class="km-text">'+e.text+"</span>"):n.text(e.text)),t="toolbar"!=e.showIcon&&(e.icon||e.spriteCssClass||e.imageUrl),t&&o(e,n),n}function o(t,n){var i,r,o,a=t.icon,s=t.spriteCssClass,l=t.imageUrl;(s||l||a)&&(i=!0,n.contents().not("span.k-sprite,span."+T+",img.k-image").each(function(t,n){(1==n.nodeType||3==n.nodeType&&e.trim(n.nodeValue).length>0)&&(i=!1)}),n.addClass(i?F:D)),a?(r=n.children("span."+T).first(),r[0]||(r=e('<span class="'+T+'"></span>').prependTo(n)),r.addClass(S+a)):s?(r=n.children("span.k-sprite").first(),r[0]||(r=e('<span class="k-sprite"></span>').prependTo(n)),r.addClass(s)):l&&(o=n.children("img.k-image").first(),o[0]||(o=e('<img alt="icon" class="k-image" />').prependTo(n)),o.attr("src",l))}function a(){var e,t=this.options.anchor,n=t.outerWidth();d.wrap(this.element).addClass("k-split-wrapper"),e="border-box"!==this.element.css("box-sizing")?n-(this.element.outerWidth()-this.element.width()):n,this.element.css({fontFamily:t.css("font-family"),"min-width":e})}function s(e){e.target.is(".k-toggle-button")||e.target.toggleClass(b,"press"==e.type)}function l(t){return t=e(t),t.hasClass("km-actionsheet")?t.closest(".km-popup-wrapper"):t.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()}var d=window.kendo,c=d.ui.Widget,u=e.proxy,p=d.isFunction,f="k-toolbar",h="k-button",m="k-overflow-button",g="k-toggle-button",v="k-button-group",_="k-split-button",k="k-toolbar-resizable",b="k-state-active",w="k-state-disabled",y="k-group-start",x="k-group-end",C="k-primary",T="k-icon",S="k-i-",F="k-button-icon",D="k-button-icontext",E="k-list-container k-split-container",A="k-split-button-arrow",H="k-overflow-anchor",I="k-overflow-container",N="k-toolbar-first-visible",M="k-toolbar-last-visible",R="click",O="toggle",P="open",z="close",L="overflowOpen",B="overflowClose",W="never",U="auto",V="always",q="k-overflow-hidden",j=d.attr("uid"),G={button:{base:n,toolbar:i,overflow:r},buttonGroup:{base:function(t,n,i){var r,o,a=t.buttons;for(i.data({type:"buttonGroup"}),i.attr(j,t.uid),o=0;a.length>o;o++)a[o].uid||(a[o].uid=d.guid()),r=n(e.extend({mobile:t.mobile},a[o])),r.appendTo(i);i.children().first().addClass(y),i.children().last().addClass(x)},toolbar:function(t){var n=e('<div class="'+v+'"></div>');return G.buttonGroup.base(t,G.button.toolbar,n),t.align&&n.addClass("k-align-"+t.align),t.id&&n.attr("id",t.id),n},overflow:function(t){var n=e('<li class="'+(t.mobile?"":v)+' k-overflow-group"></li>');return G.buttonGroup.base(t,G.button.overflow,n),t.id&&n.attr("id",t.id+"_overflow"),n}},splitButton:{toolbar:function(t){var n,i,r,o=e('<div class="'+_+'"></div>'),s=G.button.toolbar(t),d=e('<a class="'+h+" "+A+'"><span class="'+(t.mobile?"km-icon km-arrowdown":"k-icon k-i-arrow-s")+'"></span></a>'),c=e('<ul class="'+E+'"></ul>'),u=t.menuButtons;for(s.appendTo(o),d.appendTo(o),c.appendTo(o),r=0;u.length>r;r++)i=G.button.toolbar(e.extend({mobile:t.m
|