/* * Kendo UI Beta v2013.2.716 (http://kendoui.com) * Copyright 2013 Telerik AD. All rights reserved. * * Kendo UI Beta license terms available at * http://www.kendoui.com/purchase/license-agreement/kendo-ui-beta.aspx */ ("function"==typeof define&&define.amd?define:function(e,t){return t()})(["./kendo.core.min","./kendo.userevents.min"],function(){!function(e){function t(e,t){var n=s.getOffset(e),i=t.left+t.width,l=t.top+t.height;return n.right=n.left+e.outerWidth(),n.bottom=n.top+e.outerHeight(),!(n.left>i||n.rightl||n.bottoml;l++)o=e.eq(l),t(o,i)?o.hasClass(c)?s&&n!==o[0]&&o.removeClass(c).addClass(h):o.hasClass(f)||o.hasClass(h)||o.addClass(f):o.hasClass(f)?o.removeClass(f):s&&o.hasClass(h)&&o.removeClass(h).addClass(c)}var i,s=window.kendo,l=s.ui.Widget,a=e.proxy,o=Math.abs,r="aria-selected",c="k-state-selected",f="k-state-selecting",u="k-selectable",d="change",v=".kendoSelectable",h="k-state-unselecting",m=!1;!function(e){!function(){e('
').on("click",">*",function(){m=!0}).find("span").click().end().off()}()}(e),i=l.extend({init:function(t,n){var i,o=this;l.fn.init.call(o,t,n),o._marquee=e("
"),o._lastActive=null,o.element.addClass(u),i=o.options.multiple,o.userEvents=new s.UserEvents(o.element,{global:!0,allowSelection:!0,filter:(m?"":"."+u+" ")+o.options.filter,tap:a(o._tap,o)}),i&&o.userEvents.bind("start",a(o._start,o)).bind("move",a(o._move,o)).bind("end",a(o._end,o)).bind("select",a(o._select,o))},events:[d],options:{name:"Selectable",filter:">*",multiple:!1},_tap:function(t){var n,i=e(t.target),s=this,l=t.event.ctrlKey||t.event.metaKey,a=s.options.multiple,o=a&&t.event.shiftKey,r=t.event.which,f=t.event.button;i.closest("."+u)[0]!==s.element[0]||r&&3==r||f&&2==f||(n=i.hasClass(c),a&&l||s.clear(),o?s.selectRange(s._firstSelectee(),i):(n&&l?(s._unselect(i),s._notify(d)):s.value(i),s._lastActive=s._downTarget=i))},_start:function(t){var n=this,i=e(t.target),s=i.hasClass(c),l=t.event.ctrlKey||t.event.metaKey;return n._downTarget=i,i.closest("."+u)[0]!==n.element[0]?(n.userEvents.cancel(),n._downTarget=null,undefined):(n._marquee.appendTo(document.body).css({left:t.x.client+1,top:t.y.client+1,width:0,height:0}),l||n.clear(),s&&(n._selectElement(i,!0),l&&i.addClass(h)),undefined)},_move:function(e){var t=this,i={left:e.x.startLocation>e.x.location?e.x.location:e.x.startLocation,top:e.y.startLocation>e.y.location?e.y.location:e.y.startLocation,width:o(e.x.initialDelta),height:o(e.y.initialDelta)},s=t.element.find(t.options.filter);t._marquee.css(i),n(s,t._downTarget[0],i,e.event.ctrlKey||e.event.metaKey),e.preventDefault()},_end:function(){var e=this;e._marquee.remove(),e._unselect(e.element.find(e.options.filter+"."+h)).removeClass(h),e.value(e.element.find(e.options.filter+"."+f)),e._lastActive=e._downTarget},value:function(e){var t=this,n=a(t._selectElement,t);return e?(e.each(function(){n(this)}),t._notify(d),undefined):t.element.find(t.options.filter+"."+c)},_firstSelectee:function(){var e,t=this;return null!==t._lastActive?t._lastActive:(e=t.value(),e.length>0?e[0]:t.element.find(t.options.filter))},_selectElement:function(t,n){var i=e(t),s=!n&&this._notify("select",{element:t});i.removeClass(f),s||(i.addClass(c),this.options.aria&&i.attr(r,!0))},_notify:function(e,t){return t=t||{},this.trigger(e,t)},_unselect:function(e){return e.removeClass(c),this.options.aria&&e.attr(r,!1),e},_select:function(t){e(t.event.target).is("input,a,textarea")?(this.userEvents.cancel(),this._downTarget=null):t.preventDefault()},clear:function(){var e=this.element.find(this.options.filter+"."+c);this._unselect(e)},selectRange:function(t,n){var i,s,l,o,r=this,f=!1,u=r.element.find(r.options.filter),v=a(r._selectElement,r);for(t=e(t)[0],n=e(n)[0],i=0,s=u.length;s>i;i++)o=u[i],f?(v(o),f=o!==n):o===t?(f=t!==n,v(o)):o===n?(l=t,t=n,n=l,f=!0,v(o)):e(o).removeClass(c);r._notify(d)},destroy:function(){var e=this;l.fn.destroy.call(e),e.element.off(v),e.userEvents.destroy()}}),s.ui.plugin(i)}(window.kendo.jQuery)});