16 lines
20 KiB
JavaScript
16 lines
20 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.popup.min"],e)}(function(){return function(e,t){function n(e,t){return e=e.split(" ")[!t+0]||e,e.replace("top","up").replace("bottom","down")}function i(e,t,n){e=e.split(" ")[!t+0]||e;var i={origin:["bottom",n?"right":"left"],position:["top",n?"right":"left"]},r=/left|right/.test(e);return r?(i.origin=["top",e],i.position[1]=u.directions[e].reverse):(i.origin[0]=e,i.position[0]=u.directions[e].reverse),i.origin=i.origin.join(" "),i.position=i.position.join(" "),i}function r(t,n){try{return e.contains(t,n)}catch(i){return!1}}function o(t){t=e(t),t.addClass("k-item").children(x).addClass(I),t.children("a").addClass(S).children(x).addClass(I),t.filter(":not([disabled])").addClass(j),t.filter(".k-separator:empty").append(" "),t.filter("li[disabled]").addClass(G).removeAttr("disabled").attr("aria-disabled",!0),t.filter("[role]").length||t.attr("role","menuitem"),t.children("."+S).length||t.contents().filter(function(){return!(this.nodeName.match(w)||3==this.nodeType&&!e.trim(this.nodeValue))}).wrapAll("<span class='"+S+"'/>"),a(t),s(t)}function a(t){t=e(t),t.find("> .k-link > [class*=k-i-arrow]:not(.k-sprite)").remove(),t.filter(":has(.k-menu-group)").children(".k-link:not(:has([class*=k-i-arrow]:not(.k-sprite)))").each(function(){var t=e(this),n=t.parent().parent();t.append("<span class='k-icon "+(n.hasClass(T+"-horizontal")?"k-i-arrow-s":"k-i-arrow-e")+"'/>")})}function s(t){t=e(t),t.filter(".k-first:not(:first-child)").removeClass(M),t.filter(".k-last:not(:last-child)").removeClass(F),t.filter(":first-child").addClass(M),t.filter(":last-child").addClass(F)}var l,u=window.kendo,c=u.ui,d=u._activeElement,f=u.support.touch&&u.support.mobileOS,p="mousedown",h="click",g=e.extend,m=e.proxy,v=e.each,_=u.template,y=u.keys,b=c.Widget,w=/^(ul|a|div)$/i,k=".kendoMenu",x="img",C="open",T="k-menu",S="k-link",F="k-last",D="close",E="timer",M="k-first",I="k-image",A="select",H="zIndex",O="activate",z="deactivate",P="touchstart"+k+" MSPointerDown"+k+" pointerdown"+k,N=u.support.pointers,R=u.support.msPointers,B=R||N,L=N?"pointerover":R?"MSPointerOver":"mouseenter",q=N?"pointerout":R?"MSPointerOut":"mouseleave",W=f||B,V=e(document.documentElement),U="kendoPopup",j="k-state-default",Y="k-state-hover",$="k-state-focused",G="k-state-disabled",Q=".k-menu",K=".k-menu-group",J=K+",.k-animation-container",X=":not(.k-list) > .k-item",Z=".k-item.k-state-disabled",et=".k-item:not(.k-state-disabled)",tt=".k-item:not(.k-state-disabled) > .k-link",nt=":not(.k-item.k-separator)",it=nt+":eq(0)",rt=nt+":last",ot="div:not(.k-animation-container,.k-list-container)",at={2:1,touch:1},st={content:_("<div class='k-content' tabindex='-1'>#= content(item) #</div>"),group:_("<ul class='#= groupCssClass(group) #'#= groupAttributes(group) # role='menu' aria-hidden='true'>#= renderItems(data) #</ul>"),itemWrapper:_("<#= tag(item) # class='#= textClass(item) #'#= textAttributes(item) #>#= image(item) ##= sprite(item) ##= text(item) ##= arrow(data) #</#= tag(item) #>"),item:_("<li class='#= wrapperCssClass(group, item) #' role='menuitem' #=item.items ? \"aria-haspopup='true'\": \"\"##=item.enabled === false ? \"aria-disabled='true'\" : ''#>#= itemWrapper(data) ## if (item.items) { ##= subGroup({ items: item.items, menu: menu, group: { expanded: item.expanded } }) ## } else if (item.content || item.contentUrl) { ##= renderContent(data) ## } #</li>"),image:_("<img class='k-image' alt='' src='#= imageUrl #' />"),arrow:_("<span class='#= arrowClass(item, group) #'></span>"),sprite:_("<span class='k-sprite #= spriteCssClass #'></span>"),empty:_("")},lt={wrapperCssClass:function(e,t){var n="k-item",i=t.index;return n+=t.enabled===!1?" k-state-disabled":" k-state-default",e.firstLevel&&0===i&&(n+=" k-first"),i==e.length-1&&(n+=" k-last"),t.cssClass&&(n+=" "+t.cssClass),n},textClass:function(){return S},textAttributes:function(e){return e.url?" href='"+e.url+"'":""},arrowClass:function(e,t){var n="k-icon";return n+=t.horizontal?" k-i-arrow-s":" k-i-arrow-e"},text:function(e){return e.encoded===!1?e.text:u.htmlEncode(e.text)},tag:function(e){return e.url?"a":"span"},groupAttributes:function(e){return e.expanded!==!0?" style='display:none'":""},groupCssClass:function(){return"k-group k-menu-group"},content:function(e){return e.content?e.content:" "}},ut=b.extend({init:function(t,n){var i=this;b.fn.init.call(i,t,n),t=i.wrapper=i.element,n=i.options,i._initData(n),i._updateClasses(),i._animations(n),i.nextItemZIndex=100,i._tabindex(),i._focusProxy=m(i._focusHandler,i),t.on(P,i._focusProxy).on(h+k,Z,!1).on(h+k,et,m(i._click,i)).on("keydown"+k,m(i._keydown,i)).on("focus"+k,m(i._focus,i)).on("focus"+k,".k-content",m(i._focus,i)).on(P+" "+p+k,".k-content",m(i._preventClose,i)).on("blur"+k,m(i._removeHoverItem,i)).on("blur"+k,"[tabindex]",m(i._checkActiveElement,i)).on(L+k,et,m(i._mouseenter,i)).on(q+k,et,m(i._mouseleave,i)).on(L+k+" "+q+k+" "+p+k+" "+h+k,tt,m(i._toggleHover,i)),n.openOnClick&&(i.clicked=!1,i._documentClickHandler=m(i._documentClick,i),e(document).click(i._documentClickHandler)),t.attr("role","menubar"),t[0].id&&(i._ariaId=u.format("{0}_mn_active",t[0].id)),u.notify(i)},events:[C,D,O,z,A],options:{name:"Menu",animation:{open:{duration:200},close:{duration:100}},orientation:"horizontal",direction:"default",openOnClick:!1,closeOnClick:!0,hoverDelay:100,popupCollision:t},_initData:function(e){var t=this;e.dataSource&&(t.angular("cleanup",function(){return{elements:t.element.children()}}),t.element.empty(),t.append(e.dataSource,t.element),t.angular("compile",function(){return{elements:t.element.children()}}))},setOptions:function(e){var t=this.options.animation;this._animations(e),e.animation=g(!0,t,e.animation),"dataSource"in e&&this._initData(e),this._updateClasses(),b.fn.setOptions.call(this,e)},destroy:function(){var t=this;b.fn.destroy.call(t),t.element.off(k),t._documentClickHandler&&e(document).unbind("click",t._documentClickHandler),u.destroy(t.element)},enable:function(e,t){return this._toggleDisabled(e,t!==!1),this},disable:function(e){return this._toggleDisabled(e,!1),this},append:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.length?t.find("> .k-menu-group, > .k-animation-container > .k-menu-group"):null);return v(n.items,function(){n.group.append(this),a(this)}),a(t),s(n.group.find(".k-first, .k-last").add(n.items)),this},insertBefore:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.parent());return v(n.items,function(){t.before(this),a(this),s(this)}),s(t),this},insertAfter:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.parent());return v(n.items,function(){t.after(this),a(this),s(this)}),s(t),this},_insert:function(t,n,i){var r,a,s,l,u=this;return n&&n.length||(i=u.element),s=e.isPlainObject(t),l={firstLevel:i.hasClass(T),horizontal:i.hasClass(T+"-horizontal"),expanded:!0,length:i.children().length},n&&!i.length&&(i=e(ut.renderGroup({group:l})).appendTo(n)),s||e.isArray(t)?r=e(e.map(s?[t]:t,function(t,n){return"string"==typeof t?e(t).get():e(ut.renderItem({group:l,item:g(t,{index:n})})).get()})):(r="string"==typeof t&&"<"!=t[0]?u.element.find(t):e(t),a=r.find("> ul").addClass("k-menu-group").attr("role","menu"),r=r.filter("li"),r.add(a.find("> li")).each(function(){o(this)})),{items:r,group:i}},remove:function(e){var t,n,i,r;return e=this.element.find(e),t=this,n=e.parentsUntil(t.element,X),i=e.parent("ul:not(.k-menu)"),e.remove(),i&&!i.children(X).length&&(r=i.parent(".k-animation-container"),r.length?r.remove():i.remove()),n.length&&(n=n.eq(0),a(n),s(n)),t},open:function(r){var o=this,a=o.options,s="horizontal"==a.orientation,l=a.direction,c=u.support.isRtl(o.wrapper);return r=o.element.find(r),/^(top|bottom|default)$/.test(l)&&(l=c?s?(l+" left").replace("default","bottom"):"left":s?(l+" right").replace("default","bottom"):"right"),r.siblings().find(">.k-popup:visible,>.k-animation-container>.k-popup:visible").each(function(){var t=e(this).data("kendoPopup");t&&t.close()}),r.each(function(){var r=e(this);clearTimeout(r.data(E)),r.data(E,setTimeout(function(){var d,f,p,h,m,v,_,y,b=r.find(".k-menu-group:first:hidden");b[0]&&o._triggerEvent({item:r[0],type:C})===!1&&(!b.find(".k-menu-group")[0]&&b.children(".k-item").length>1?(f=e(window).height(),p=function(){b.css({maxHeight:f-(b.outerHeight()-b.height())-u.getShadows(b).bottom,overflow:"auto"})},u.support.browser.msie&&7>=u.support.browser.version?setTimeout(p,0):p()):b.css({maxHeight:"",overflow:""}),r.data(H,r.css(H)),r.css(H,o.nextItemZIndex++),d=b.data(U),h=r.parent().hasClass(T),m=h&&s,v=i(l,h,c),_=a.animation.open.effects,y=_!==t?_:"slideIn:"+n(l,h),d?(d=b.data(U),d.options.origin=v.origin,d.options.position=v.position,d.options.animation.open.effects=y):d=b.kendoPopup({activate:function(){o._triggerEvent({item:this.wrapper.parent(),type:O})},deactivate:function(){o._triggerEvent({item:this.wrapper.parent(),type:z})},origin:v.origin,position:v.position,collision:a.popupCollision!==t?a.popupCollision:m?"fit":"fit flip",anchor:r,appendTo:r,animation:{open:g(!0,{effects:y},a.animation.open),close:a.animation.close},close:function(e){var t=e.sender.wrapper.parent();o._triggerEvent({item:t[0],type:D})?e.preventDefault():(t.css(H,t.data(H)),t.removeData(H),W&&(t.removeClass(Y),o._removeHoverItem()))}}).data(U),b.removeAttr("aria-hidden"),d.open())},o.options.hoverDelay))}),o},close:function(t,n){var i=this,r=i.element;return t=r.find(t),t.length||(t=r.find(">.k-item")),t.each(function(){var t=e(this);!n&&i._isRootItem(t)&&(i.clicked=!1),clearTimeout(t.data(E)),t.data(E,setTimeout(function(){var e=t.find(".k-menu-group:not(.k-list-container):not(.k-calendar-container):first:visible").data(U);e&&(e.close(),e.element.attr("aria-hidden",!0))},i.options.hoverDelay))}),i},_toggleDisabled:function(t,n){this.element.find(t).each(function(){e(this).toggleClass(j,n).toggleClass(G,!n).attr("aria-disabled",!n)})},_toggleHover:function(t){var n=e(u.eventTarget(t)||t.target).closest(X),i=t.type==L||-1!==p.indexOf(t.type);n.parents("li."+G).length||n.toggleClass(Y,i||"mousedown"==t.type||"click"==t.type),this._removeHoverItem()},_preventClose:function(){this.options.closeOnClick||(this._closurePrevented=!0)},_checkActiveElement:function(t){var n=this,i=e(t?t.currentTarget:this._hoverItem()),o=n._findRootParent(i)[0];this._closurePrevented||setTimeout(function(){(!document.hasFocus()||!r(o,u._activeElement())&&t&&!r(o,t.currentTarget))&&n.close(o)},0),this._closurePrevented=!1},_removeHoverItem:function(){var e=this._hoverItem();e&&e.hasClass($)&&(e.removeClass($),this._oldHoverItem=null)},_updateClasses:function(){var e,t=this.element,n=Q+" div ul";t.removeClass("k-menu-horizontal k-menu-vertical"),t.addClass("k-widget k-reset k-header "+T).addClass(T+"-"+this.options.orientation),t.find("li > ul").filter(function(){return!u.support.matchesSelector.call(this,n)}).addClass("k-group k-menu-group").attr("role","menu").attr("aria-hidden",t.is(":visible")).end().find("li > div").addClass("k-content").attr("tabindex","-1"),e=t.find("> li,.k-menu-group > li"),e.each(function(){o(this)})},_mouseenter:function(t){var n=this,i=e(t.currentTarget),o=i.children(".k-animation-container").length||i.children(K).length;t.delegateTarget==i.parents(Q)[0]&&(n.options.openOnClick&&!n.clicked||f||(N||R)&&t.originalEvent.pointerType in at&&n._isRootItem(i.closest(X))||!r(t.currentTarget,t.relatedTarget)&&o&&n.open(i),(n.options.openOnClick&&n.clicked||W)&&i.siblings().each(m(function(e,t){n.close(t,!0)},n)))},_mouseleave:function(n){var i=this,o=e(n.currentTarget),a=o.children(".k-animation-container").length||o.children(K).length;return o.parentsUntil(".k-animation-container",".k-list-container,.k-calendar-container")[0]?(n.stopImmediatePropagation(),t):(i.options.openOnClick||f||(N||R)&&n.originalEvent.pointerType in at||r(n.currentTarget,n.relatedTarget||n.target)||!a||r(n.currentTarget,u._activeElement())||i.close(o),t)},_click:function(n){var i,r,o,a=this,s=a.options,l=e(u.eventTarget(n)),c=l[0]?l[0].nodeName.toUpperCase():"",d="INPUT"==c||"SELECT"==c||"BUTTON"==c||"LABEL"==c,f=l.closest("."+S),p=l.closest(X),h=f.attr("href"),g=l.attr("href"),m=e("<a href='#' />").attr("href"),v=!!h&&h!==m,_=!!g&&g!==m;if(s.openOnClick||!p.children(ot)[0]){if(p.hasClass(G))return n.preventDefault(),t;if(n.handled||!a._triggerEvent({item:p[0],type:A})||d||n.preventDefault(),n.handled=!0,r=p.children(J),o=r.is(":visible"),s.closeOnClick&&!v&&(!r.length||s.openOnClick&&o&&a._isRootItem(p)))return p.removeClass(Y).css("height"),a._oldHoverItem=a._findRootParent(p),a.close(f.parentsUntil(a.element,X)),a.clicked=!1,-1!="MSPointerUp".indexOf(n.type)&&n.preventDefault(),t;v&&n.enterKey&&f[0].click(),(p.parent().hasClass(T)&&s.openOnClick||u.support.touch)&&(v||d||_||n.preventDefault(),a.clicked=!0,i=r.is(":visible")?D:C,(s.closeOnClick||i!=D)&&a[i](p))}},_documentClick:function(e){r(this.element[0],e.target)||(this.clicked=!1)},_focus:function(n){var i=this,r=n.target,o=i._hoverItem(),a=d();return r==i.wrapper[0]||e(r).is(":kendoFocusable")?(a===n.currentTarget&&(o.length?i._moveHover([],o):i._oldHoverItem||i._moveHover([],i.wrapper.children().first())),t):(n.stopPropagation(),e(r).closest(".k-content").closest(".k-menu-group").closest(".k-item").addClass($),i.wrapper.focus(),t)},_keydown:function(e){var n,i,r,o=this,a=e.keyCode,s=o._oldHoverItem,l=u.support.isRtl(o.wrapper);if(e.target==e.currentTarget||a==y.ESC){if(s||(s=o._oldHoverItem=o._hoverItem()),i=o._itemBelongsToVertival(s),r=o._itemHasChildren(s),a==y.RIGHT)n=o[l?"_itemLeft":"_itemRight"](s,i,r);else if(a==y.LEFT)n=o[l?"_itemRight":"_itemLeft"](s,i,r);else if(a==y.DOWN)n=o._itemDown(s,i,r);else if(a==y.UP)n=o._itemUp(s,i,r);else if(a==y.ESC)n=o._itemEsc(s,i);else if(a==y.ENTER||a==y.SPACEBAR)n=s.children(".k-link"),n.length>0&&(o._click({target:n[0],preventDefault:function(){},enterKey:!0}),o._moveHover(s,o._findRootParent(s)));else if(a==y.TAB)return n=o._findRootParent(s),o._moveHover(s,n),o._checkActiveElement(),t;n&&n[0]&&(e.preventDefault(),e.stopPropagation())}},_hoverItem:function(){return this.wrapper.find(".k-item.k-state-hover,.k-item.k-state-focused").filter(":visible")},_itemBelongsToVertival:function(e){var t=this.wrapper.hasClass("k-menu-vertical");return e.length?e.parent().hasClass("k-menu-group")||t:t},_itemHasChildren:function(e){return e.length?e.children("ul.k-menu-group, div.k-animation-container").length>0:!1},_moveHover:function(t,n){var i=this,r=i._ariaId;t.length&&n.length&&t.removeClass($),n.length&&(n[0].id&&(r=n[0].id),n.addClass($),i._oldHoverItem=n,r&&(i.element.removeAttr("aria-activedescendant"),e("#"+r).removeAttr("id"),n.attr("id",r),i.element.attr("aria-activedescendant",r)))},_findRootParent:function(e){return this._isRootItem(e)?e:e.parentsUntil(Q,"li.k-item").last()},_isRootItem:function(e){return e.parent().hasClass(T)},_itemRight:function(e,t,n){var i,r,o=this;if(!e.hasClass(G))return t?n?(o.open(e),i=e.find(".k-menu-group").children().first()):"horizontal"==o.options.orientation&&(r=o._findRootParent(e),o.close(r),i=r.nextAll(it)):(i=e.nextAll(it),i.length||(i=e.prevAll(rt))),i&&!i.length?i=o.wrapper.children(".k-item").first():i||(i=[]),o._moveHover(e,i),i},_itemLeft:function(e,t){var n,i=this;return t?(n=e.parent().closest(".k-item"),i.close(n),i._isRootItem(n)&&"horizontal"==i.options.orientation&&(n=n.prevAll(it))):(n=e.prevAll(it),n.length||(n=e.nextAll(rt))),n.length||(n=i.wrapper.children(".k-item").last()),i._moveHover(e,n),n},_itemDown:function(e,t,n){var i,r=this;if(t)i=e.nextAll(it);else{if(!n||e.hasClass(G))return;r.open(e),i=e.find(".k-menu-group").children().first()}return!i.length&&e.length?i=e.parent().children().first():e.length||(i=r.wrapper.children(".k-item").first()),r._moveHover(e,i),i},_itemUp:function(e,t){var n,i=this;if(t)return n=e.prevAll(it),!n.length&&e.length?n=e.parent().children().last():e.length||(n=i.wrapper.children(".k-item").last()),i._moveHover(e,n),n},_itemEsc:function(e,t){var n,i=this;return t?(n=e.parent().closest(".k-item"),i.close(n),i._moveHover(e,n),n):e},_triggerEvent:function(e){var t=this;return t.trigger(e.type,{type:e.type,item:e.item})},_focusHandler:function(t){var n=this,i=e(u.eventTarget(t)).closest(X);setTimeout(function(){n._moveHover([],i),i.children(".k-content")[0]&&i.parent().closest(".k-item").removeClass($)},200)},_animations:function(e){e&&"animation"in e&&!e.animation&&(e.animation={open:{effects:{}},close:{hide:!0,effects:{}}})}});g(ut,{renderItem:function(e){e=g({menu:{},group:{}},e);var t=st.empty,n=e.item;return st.item(g(e,{image:n.imageUrl?st.image:t,sprite:n.spriteCssClass?st.sprite:t,itemWrapper:st.itemWrapper,renderContent:ut.renderContent,arrow:n.items||n.content?st.arrow:t,subGroup:ut.renderGroup},lt))},renderGroup:function(e){return st.group(g({renderItems:function(e){for(var t="",n=0,i=e.items,r=i?i.length:0,o=g({length:r},e.group);r>n;n++)t+=ut.renderItem(g(e,{group:o,item:g({index:n},i[n])}));return t}},e,lt))},renderContent:function(e){return st.content(g(e,lt))}}),l=ut.extend({init:function(t,n){var i=this;ut.fn.init.call(i,t,n),i.target=e(i.options.target),i._popup(),i._wire()},options:{name:"ContextMenu",filter:null,showOn:"contextmenu",orientation:"vertical",alignToAnchor:!1,target:"body"},events:[C,D,O,z,A],setOptions:function(t){var n=this;ut.fn.setOptions.call(n,t),n.target.off(n.showOn+k,n._showProxy),n.userEvents&&n.userEvents.destroy(),n.target=e(n.options.target),t.orientation&&n.popup.wrapper[0]&&n.popup.element.unwrap(),n._wire(),ut.fn.setOptions.call(this,t)},destroy:function(){var e=this;e.target.off(e.options.showOn+k),V.off(u.support.mousedown+k,e._closeProxy),e.userEvents&&e.userEvents.destroy(),ut.fn.destroy.call(e)},open:function(n,i){var o=this;return n=e(n)[0],r(o.element[0],e(n)[0])?ut.fn.open.call(o,n):o._triggerEvent({item:o.element,type:C})===!1&&(o.popup.visible()&&o.options.filter&&o.popup.close(!0),i!==t?(o.popup.wrapper.hide(),o.popup.open(n,i)):(o.popup.options.anchor=(n?n:o.popup.anchor)||o.target,o.popup.open()),V.off(p,o.popup._mousedownProxy),V.on(u.support.mousedown+k,o._closeProxy)),o},close:function(){var t=this;r(t.element[0],e(arguments[0])[0])?ut.fn.close.call(t,arguments[0]):t.popup.visible()&&t._triggerEvent({item:t.element,type:D})===!1&&(t.popup.close(),V.off(u.support.mousedown+k,t._closeProxy),t.unbind(A,t._closeTimeoutProxy))},_showHandler:function(e){var t,n=e,i=this,o=i.options;e.event&&(n=e.event,n.pageX=e.x.location,n.pageY=e.y.location),r(i.element[0],e.relatedTarget||e.target)||(i._eventOrigin=n,n.preventDefault(),n.stopImmediatePropagation(),i.element.find("."+$).removeClass($),(o.filter&&u.support.matchesSelector.call(n.currentTarget,o.filter)||!o.filter)&&(o.alignToAnchor?i.open(n.currentTarget):i._targetChild?(t=i.target.offset(),i.open(n.pageX-t.left,n.pageY-t.top)):i.open(n.pageX,n.pageY)))},_closeHandler:function(t){var n=this,i=t.relatedTarget||t.target,o=e(i).closest(et).children(J),a=r(n.element[0],i);n._eventOrigin=t,!n.popup.visible()||3===t.which||(!n.options.closeOnClick||f||(N||R)&&t.originalEvent.pointerType in at||o[0]||!a)&&a||(a?(this.unbind(A,this._closeTimeoutProxy),n.bind(A,n._closeTimeoutProxy)):n.close())},_wire:function(){var e=this,t=e.options,n=e.target;e._showProxy=m(e._showHandler,e),e._closeProxy=m(e._closeHandler,e),e._closeTimeoutProxy=m(e.close,e),n[0]&&(u.support.mobileOS&&"contextmenu"==t.showOn?(e.userEvents=new u.UserEvents(n,{filter:t.filter,allowSelection:!1}),n.on(t.showOn+k,!1),e.userEvents.bind("hold",e._showProxy)):t.filter?n.on(t.showOn+k,t.filter,e._showProxy):n.on(t.showOn+k,e._showProxy))},_triggerEvent:function(n){var i=this,r=e(i.popup.options.anchor)[0],o=i._eventOrigin;return i._eventOrigin=t,i.trigger(n.type,g({type:n.type,item:n.item||this.element[0],target:r},o?{event:o}:{}))},_popup:function(){var e=this;e._triggerProxy=m(e._triggerEvent,e),e.popup=e.element.addClass("k-context-menu").kendoPopup({anchor:e.target||"body",collision:e.options.popupCollision||"fit",animation:e.options.animation,activate:e._triggerProxy,deactivate:e._triggerProxy}).data("kendoPopup"),e._targetChild=r(e.target[0],e.popup.element[0])}}),c.plugin(ut),c.plugin(l)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()}); |