EOS/Scripts/kendo/2015.3.1111/kendo.mobile.buttongroup.min.js
Nidhi Bhargava f0c1ab20e1 code push
2025-09-04 16:25:07 +05:30

9 lines
2.1 KiB
JavaScript

/*
* Kendo UI v2015.3.1111 (http://www.telerik.com/kendo-ui)
* Copyright 2015 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(e,define){define(["./kendo.core.min"],e)}(function(){return function(e,t){function n(t){return e('<span class="km-badge">'+t+"</span>")}var i=window.kendo,o=i.mobile.ui,r=o.Widget,a="km-state-active",s="km-state-disabled",l="select",c="li:not(."+a+")",u=r.extend({init:function(e,t){var n=this;r.fn.init.call(n,e,t),n.element.addClass("km-buttongroup").find("li").each(n._button),n.element.on(n.options.selectOn,c,"_select"),n._enable=!0,n.select(n.options.index),n.options.enable||(n._enable=!1,n.wrapper.addClass(s))},events:[l],options:{name:"ButtonGroup",selectOn:"down",index:-1,enable:!0},current:function(){return this.element.find("."+a)},select:function(n){var i=this,o=-1;n!==t&&-1!==n&&i._enable&&!e(n).is("."+s)&&(i.current().removeClass(a),"number"==typeof n?(o=n,n=e(i.element[0].children[n])):n.nodeType&&(n=e(n),o=n.index()),n.addClass(a),i.selectedIndex=o)},badge:function(t,i){var o,r=this.element;return isNaN(t)||(t=r.children().get(t)),t=r.find(t),o=e(t.children(".km-badge")[0]||n(i).appendTo(t)),i||0===i?(o.html(i),this):i===!1?(o.empty().remove(),this):o.html()},enable:function(e){var n=this.wrapper;t===e&&(e=!0),e?n.removeClass(s):n.addClass(s),this._enable=this.options.enable=e},_button:function(){var t=e(this).addClass("km-button"),o=i.attrValue(t,"icon"),r=i.attrValue(t,"badge"),a=t.children("span"),s=t.find("img").addClass("km-image");a[0]||(a=t.wrapInner("<span/>").children("span")),a.addClass("km-text"),!s[0]&&o&&t.prepend(e('<span class="km-icon km-'+o+'"/>')),(r||0===r)&&n(r).appendTo(t)},_select:function(e){e.which>1||e.isDefaultPrevented()||!this._enable||(this.select(e.currentTarget),this.trigger(l,{index:this.selectedIndex}))}});o.plugin(u)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});