{"version":3,"sources":["kendo.menu.js"],"names":["f","define","$","undefined","getEffectDirection","direction","root","split","replace","parseDirection","isRtl","output","origin","position","horizontal","test","kendo","directions","reverse","join","contains","parent","child","e","updateItemClasses","item","addClass","children","IMG","IMAGE","LINK","filter","DEFAULTSTATE","empty","append","DISABLEDSTATE","removeAttr","attr","length","contents","this","nodeName","match","excludedNodesRegExp","nodeType","trim","nodeValue","wrapAll","updateArrow","updateFirstLast","find","remove","each","arrowCssClass","getArrowCssClass","support","hasClass","MENU","removeClass","FIRST","LAST","storeItemSelectEventHandler","element","options","selectHandler","getItemSelectEventHandler","setItemData","items","i","data","select","isFunction","popupOpenerSelector","id","popupGroupSelector","getChildPopups","currentPopup","overflowWrapper","childPopupOpener","result","opener","popupId","popup","POPUP_OPENER_ATTR","push","popupParentItem","popupElement","POPUP_ID_ATTR","itemPopup","animationContainerSelector","overflowMenuParents","current","last","parents","getParents","parentNode","is","elem","mousewheelDelta","delta","wheelDelta","Math","ceil","floor","detail","round","parentsScroll","scrollDirection","scroll","isNaN","isPointerTouch","allPointers","originalEvent","pointerType","touchPointerTypes","isTouch","ev","touch","type","removeSpacesBetweenItems","ul","ContextMenu","window","ui","activeElement","_activeElement","mobileOS","MOUSEDOWN","CLICK","DELAY","SCROLLSPEED","extend","proxy","template","keys","Widget","NS","OPEN","CLOSE","TIMER","SELECT","ZINDEX","ACTIVATE","DEACTIVATE","POINTERDOWN","pointers","msPointers","MOUSEENTER","MOUSELEAVE","MOUSEWHEEL","RESIZE","resize","SCROLLWIDTH","SCROLLHEIGHT","OFFSETWIDTH","OFFSETHEIGHT","DOCUMENT_ELEMENT","document","documentElement","KENDOPOPUP","HOVERSTATE","FOCUSEDSTATE","SELECTEDSTATE","menuSelector","groupSelector","popupSelector","allItemsSelector","disabledSelector","itemSelector","linkSelector","exclusionSelector","nextSelector","lastSelector","templateSelector","scrollButtonSelector","2","templates","content","group","itemWrapper","scrollButton","image","arrow","sprite","rendering","wrapperCssClass","index","enabled","firstLevel","cssClass","hasOwnProperty","selected","itemCssAttributes","attributes","imageCssAttributes","imageAttr","contentCssAttributes","contentAttr","defaultClasses","textClass","textAttributes","url","arrowClass","text","encoded","htmlEncode","tag","groupAttributes","expanded","groupCssClass","Menu","init","that","fn","call","wrapper","_initData","_updateClasses","_animations","nextItemZIndex","_tabindex","_initOverflow","_attachMenuEventsHandlers","openOnClick","clicked","_ariaId","format","notify","events","name","animation","open","duration","close","orientation","closeOnClick","hoverDelay","scrollable","popupCollision","dataSource","angular","elements","_overflowWrapper","on","_focusHandler","_click","_preventClose","_mouseenter","_mouseleave","_toggleHover","_keydown","_focus","_removeHoverItem","_checkActiveElement","_mouseleavePopup","_mouseenterPopup","_documentClickHandler","_documentClick","click","_detachMenuEventsHandlers","off","unbind","backwardBtn","forwardBtn","initialWidth","initialCssWidth","isHorizontal","_openedPopups","_scrollWrapper","wrap","add","appendTo","_initScrolling","outerWidth","style","width","throttle","_setOverflowWrapperWidth","_toggleScrollButtons","_popupsWrapper","wrapperWidth","menuWidth","borders","wrapperCssWidth","css","offsetWidth","clientWidth","min","_reinitOverflow","overflowChanged","distance","_destroyOverflow","popupWrapper","popupParentLi","unwrap","scrollElement","isNumeric","mouseWheelDistance","backward","forward","backwardDouble","forwardDouble","scrolling","touchEvents","value","scrollValue","scrollLeft","scrollTop","finish","animate","mouseenterHandler","mousedownHandler","stop","currentTarget","trigger","stopPropagation","preventDefault","eventMap","down","scrollSpeed","ctrlKey","shiftKey","altKey","abs","_closeChildPopups","currentScroll","scrollSize","offset","toggle","setOptions","destroy","enable","_toggleDisabled","disable","referenceItem","inserted","_insert","insertBefore","before","insertAfter","after","groups","plain","groupData","isPlainObject","renderGroup","isArray","map","idx","get","renderItem","charAt","container","parentsUntil","eq","visiblePopups","closePopup","siblings","li","clearTimeout","setTimeout","overflowPopup","windowHeight","setScrolling","nextZindex","parentHorizontal","effects","openEffects","_getPopup","_triggerEvent","height","maxHeight","_outerHeight","getShadows","bottom","overflow","browser","msie","version","zIndex","kendoPopup","activate","deactivate","sender","removeData","opacity","collision","anchor","_popupOpen","hide","_configurePopupOverflow","_initPopupScrolling","popupOpener","groupId","_wrapPopupElement","Date","getTime","autosize","display","skipMouseEvents","scrollHeight","offsetHeight","_initPopupScrollButtons","scrollButtons","timeout","p","isEmptyObject","_closeParentPopups","first","_setPopupHeight","isFixed","location","popupOuterHeight","popupOffsetTop","bottomScrollbar","canFit","popups","_initialHeight","_location","max","top","innerHeight","dontClearClose","hasChildPopupsHovered","isPopupMouseLeaved","_isRootItem","_forceClose","toggleClass","target","eventTarget","closest","isEnter","indexOf","_closurePrevented","hoverItem","_hoverItem","_findRootParent","hasFocus","oldHoverItem","_oldHoverItem","nonContentGroupsSelector","matchesSelector","end","hasChildren","_itemHasChildren","pointerTouch","delegateTarget","relatedTarget","_","sibling","$window","stopImmediatePropagation","toElement","clientX","clientY","_closePopups","rootPopup","groupParent","innerPopup","_innerPopup","openHandle","childGroup","childGroupVisible","shouldCloseTheRootItem","childPopupId","targetElement","toUpperCase","formNode","link","itemElement","href","targetHref","sampleHref","isLink","isLocalLink","isTargetLink","handled","_triggerSelect","_parentsUntil","enterKey","context","selector","itemSelectEventData","isSelectItemDefaultPrevented","isSelectDefaultPrevented","_getEventData","isDefaultPrevented","eventData","_defaultPrevented","active","_moveHover","focus","belongsToVertical","key","keyCode","ESC","_itemBelongsToVertival","RIGHT","LEFT","DOWN","_itemDown","UP","_itemUp","_itemEsc","ENTER","SPACEBAR","TAB","menuIsVertical","nextItem","_scrollToItem","_itemRight","parentItem","_childPopupElement","nextAll","prevAll","_itemLeft","scrollDir","getSize","currentScrollOffset","itemSize","itemOffset","ulSize","scrollButtonSize","itemPosition","_outerWidth","menu","imageUrl","spriteCssClass","renderContent","subGroup","renderItems","html","len","_marker","guid","substring","_popup","_wire","_initialWidth","showOn","alignToAnchor","_showProxy","userEvents","mousedown","_closeProxy","x","y","visible","kendoStop","left","_configurePopupScrolling","downEvent","_mousedownProxy","visibility","_setPopupWidth","windowWidth","popupOuterWidth","popupOffsetLeft","shadow","maxWidth","right","arguments","_closeTimeoutProxy","_showHandler","event","pageX","pageY","_eventOrigin","_targetChild","_closeHandler","normalClick","sameTarget","containment","which","bind","UserEvents","allowSelection","_triggerProxy","copyAnchorStyles","noop","plugin","jQuery","amd","a1","a2","a3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;CAwBC,SAAUA,EAAGC,QACVA,OAAO,cAAe,eAAgBD,IACxC,WAuvDE,MA/uDC,UAAUE,EAAGC,GA+GV,QAASC,GAAmBC,EAAWC,GAEnC,MADAD,GAAYA,EAAUE,MAAM,MAAMD,EAAO,IAAMD,EACxCA,EAAUG,QAAQ,MAAO,MAAMA,QAAQ,SAAU,QAE5D,QAASC,GAAeJ,EAAWC,EAAMI,GACrCL,EAAYA,EAAUE,MAAM,MAAMD,EAAO,IAAMD,CAC/C,IAAIM,IACIC,QACI,SACAF,EAAQ,QAAU,QAEtBG,UACI,MACAH,EAAQ,QAAU,SAEvBI,EAAa,aAAaC,KAAKV,EAatC,OAZIS,IACAH,EAAOC,QACH,MACAP,GAEJM,EAAOE,SAAS,GAAKG,EAAMC,WAAWZ,GAAWa,UAEjDP,EAAOC,OAAO,GAAKP,EACnBM,EAAOE,SAAS,GAAKG,EAAMC,WAAWZ,GAAWa,SAErDP,EAAOC,OAASD,EAAOC,OAAOO,KAAK,KACnCR,EAAOE,SAAWF,EAAOE,SAASM,KAAK,KAChCR,EAEX,QAASS,GAASC,EAAQC,GACtB,IACI,MAAOpB,GAAEkB,SAASC,EAAQC,GAC5B,MAAOC,GACL,OAAO,GAGf,QAASC,GAAkBC,GACvBA,EAAOvB,EAAEuB,GACTA,EAAKC,SAAS,UAAUC,SAASC,GAAKF,SAASG,GAC/CJ,EAAKE,SAAS,KAAKD,SAASI,GAAMH,SAASC,GAAKF,SAASG,GACzDJ,EAAKM,OAAO,oBAAoBL,SAASM,IACzCP,EAAKM,OAAO,gBAAgBE,QAAQC,OAAO,UAC3CT,EA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AAMrkB,OAAS,SAAUskB,EAAIC,EAAIC,IACrEA,GAAMD","file":"kendo.menu.min.js","sourcesContent":["/*!\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n*/\n(function (f, define) {\n define('kendo.menu', ['kendo.popup'], f);\n}(function () {\n var __meta__ = {\n id: 'menu',\n name: 'Menu',\n category: 'web',\n description: 'The Menu widget displays hierarchical data as a multi-level menu.',\n depends: ['popup']\n };\n (function ($, undefined) {\n var kendo = window.kendo, ui = kendo.ui, activeElement = kendo._activeElement, touch = kendo.support.touch && kendo.support.mobileOS, MOUSEDOWN = 'mousedown', CLICK = 'click', DELAY = 30, SCROLLSPEED = 50, extend = $.extend, proxy = $.proxy, each = $.each, template = kendo.template, keys = kendo.keys, Widget = ui.Widget, excludedNodesRegExp = /^(ul|a|div)$/i, NS = '.kendoMenu', IMG = 'img', OPEN = 'open', MENU = 'k-menu', LINK = 'k-link', LAST = 'k-last', CLOSE = 'close', TIMER = 'timer', FIRST = 'k-first', IMAGE = 'k-image', SELECT = 'select', ZINDEX = 'zIndex', ACTIVATE = 'activate', DEACTIVATE = 'deactivate', POINTERDOWN = 'touchstart' + NS + ' MSPointerDown' + NS + ' pointerdown' + NS, pointers = kendo.support.pointers, msPointers = kendo.support.msPointers, allPointers = msPointers || pointers, MOUSEENTER = pointers ? 'pointerenter' : msPointers ? 'MSPointerEnter' : 'mouseenter', MOUSELEAVE = pointers ? 'pointerleave' : msPointers ? 'MSPointerLeave' : 'mouseleave', MOUSEWHEEL = 'DOMMouseScroll' + NS + ' mousewheel' + NS, RESIZE = kendo.support.resize + NS, SCROLLWIDTH = 'scrollWidth', SCROLLHEIGHT = 'scrollHeight', OFFSETWIDTH = 'offsetWidth', OFFSETHEIGHT = 'offsetHeight', POPUP_ID_ATTR = 'group', POPUP_OPENER_ATTR = 'groupparent', DOCUMENT_ELEMENT = $(document.documentElement), KENDOPOPUP = 'kendoPopup', DEFAULTSTATE = 'k-state-default', HOVERSTATE = 'k-state-hover', FOCUSEDSTATE = 'k-state-focused', DISABLEDSTATE = 'k-state-disabled', SELECTEDSTATE = 'k-state-selected', menuSelector = '.k-menu', groupSelector = '.k-menu-group', animationContainerSelector = '.k-animation-container', popupSelector = groupSelector + ',' + animationContainerSelector, allItemsSelector = ':not(.k-list) > .k-item', disabledSelector = '.k-item.k-state-disabled', itemSelector = '.k-item:not(.k-state-disabled)', linkSelector = '.k-item:not(.k-state-disabled) > .k-link', exclusionSelector = ':not(.k-item.k-separator)', nextSelector = exclusionSelector + ':eq(0)', lastSelector = exclusionSelector + ':last', templateSelector = 'div:not(.k-animation-container,.k-list-container)', scrollButtonSelector = '.k-menu-scroll-button', touchPointerTypes = {\n '2': 1,\n 'touch': 1\n }, templates = {\n content: template('
#= content(item) #
'),\n group: template(''),\n itemWrapper: template('<#= tag(item) # class=\\'#= textClass(item) #\\'#= textAttributes(item) #>' + '#= image(data) ##= sprite(item) ##= text(item) #' + '#= arrow(data) #' + ''),\n item: template('
  • ' + '#= itemWrapper(data) #' + '# if (item.items) { #' + '#= subGroup({ items: item.items, menu: menu, group: { expanded: item.expanded } }) #' + '# } else if (item.content || item.contentUrl) { #' + '#= renderContent(data) #' + '# } #' + '
  • '),\n scrollButton: template('' + ''),\n image: template('\\'\\''),\n arrow: template(''),\n sprite: template(''),\n empty: template('')\n }, rendering = {\n wrapperCssClass: function (group, item) {\n var result = 'k-item', index = item.index;\n if (item.enabled === false) {\n result += ' k-state-disabled';\n } else {\n result += ' k-state-default';\n }\n if (group.firstLevel && index === 0) {\n result += ' k-first';\n }\n if (index == group.length - 1) {\n result += ' k-last';\n }\n if (item.cssClass) {\n result += ' ' + item.cssClass;\n }\n if (item.attr && item.attr.hasOwnProperty('class')) {\n result += ' ' + item.attr['class'];\n }\n if (item.selected) {\n result += ' ' + SELECTEDSTATE;\n }\n return result;\n },\n itemCssAttributes: function (item) {\n var result = '';\n var attributes = item.attr || {};\n for (var attr in attributes) {\n if (attributes.hasOwnProperty(attr) && attr !== 'class') {\n result += attr + '=\"' + attributes[attr] + '\" ';\n }\n }\n return result;\n },\n imageCssAttributes: function (item) {\n var result = '';\n var attributes = item.imageAttr || {};\n if (!attributes['class']) {\n attributes['class'] = IMAGE;\n } else {\n attributes['class'] += ' ' + IMAGE;\n }\n for (var attr in attributes) {\n if (attributes.hasOwnProperty(attr)) {\n result += attr + '=\"' + attributes[attr] + '\" ';\n }\n }\n return result;\n },\n contentCssAttributes: function (item) {\n var result = '';\n var attributes = item.contentAttr || {};\n var defaultClasses = 'k-content k-group k-menu-group';\n if (!attributes['class']) {\n attributes['class'] = defaultClasses;\n } else {\n attributes['class'] += ' ' + defaultClasses;\n }\n for (var attr in attributes) {\n if (attributes.hasOwnProperty(attr)) {\n result += attr + '=\"' + attributes[attr] + '\" ';\n }\n }\n return result;\n },\n textClass: function () {\n return LINK;\n },\n textAttributes: function (item) {\n return item.url ? ' href=\\'' + item.url + '\\'' : '';\n },\n arrowClass: function (item, group) {\n var result = 'k-icon';\n if (group.horizontal) {\n result += ' k-i-arrow-60-down';\n } else {\n result += ' k-i-arrow-60-right';\n }\n return result;\n },\n text: function (item) {\n return item.encoded === false ? item.text : kendo.htmlEncode(item.text);\n },\n tag: function (item) {\n return item.url ? 'a' : 'span';\n },\n groupAttributes: function (group) {\n return group.expanded !== true ? ' style=\\'display:none\\'' : '';\n },\n groupCssClass: function () {\n return 'k-group k-menu-group';\n },\n content: function (item) {\n return item.content ? item.content : ' ';\n }\n };\n function getEffectDirection(direction, root) {\n direction = direction.split(' ')[!root + 0] || direction;\n return direction.replace('top', 'up').replace('bottom', 'down');\n }\n function parseDirection(direction, root, isRtl) {\n direction = direction.split(' ')[!root + 0] || direction;\n var output = {\n origin: [\n 'bottom',\n isRtl ? 'right' : 'left'\n ],\n position: [\n 'top',\n isRtl ? 'right' : 'left'\n ]\n }, horizontal = /left|right/.test(direction);\n if (horizontal) {\n output.origin = [\n 'top',\n direction\n ];\n output.position[1] = kendo.directions[direction].reverse;\n } else {\n output.origin[0] = direction;\n output.position[0] = kendo.directions[direction].reverse;\n }\n output.origin = output.origin.join(' ');\n output.position = output.position.join(' ');\n return output;\n }\n function contains(parent, child) {\n try {\n return $.contains(parent, child);\n } catch (e) {\n return false;\n }\n }\n function updateItemClasses(item) {\n item = $(item);\n item.addClass('k-item').children(IMG).addClass(IMAGE);\n item.children('a').addClass(LINK).children(IMG).addClass(IMAGE);\n item.filter(':not([disabled])').addClass(DEFAULTSTATE);\n item.filter('.k-separator').empty().append(' ');\n item.filter('li[disabled]').addClass(DISABLEDSTATE).removeAttr('disabled').attr('aria-disabled', true);\n if (!item.filter('[role]').length) {\n item.attr('role', 'menuitem');\n }\n if (!item.children('.' + LINK).length) {\n item.contents().filter(function () {\n return !this.nodeName.match(excludedNodesRegExp) && !(this.nodeType == 3 && !$.trim(this.nodeValue));\n }).wrapAll('');\n }\n updateArrow(item);\n updateFirstLast(item);\n }\n function updateArrow(item) {\n item = $(item);\n item.find('> .k-link > [class*=k-i-arrow]:not(.k-sprite)').remove();\n item.filter(':has(.k-menu-group)').children('.k-link:not(:has([class*=k-i-arrow]:not(.k-sprite)))').each(function () {\n var item = $(this), arrowCssClass = getArrowCssClass(item);\n item.append('');\n });\n }\n function getArrowCssClass(item) {\n var arrowCssClass, parent = item.parent().parent(), isRtl = kendo.support.isRtl(parent);\n if (parent.hasClass(MENU + '-horizontal')) {\n arrowCssClass = ' k-i-arrow-60-down';\n } else {\n if (isRtl) {\n arrowCssClass = ' k-i-arrow-60-left';\n } else {\n arrowCssClass = ' k-i-arrow-60-right';\n }\n }\n return arrowCssClass;\n }\n function updateFirstLast(item) {\n item = $(item);\n item.filter('.k-first:not(:first-child)').removeClass(FIRST);\n item.filter('.k-last:not(:last-child)').removeClass(LAST);\n item.filter(':first-child').addClass(FIRST);\n item.filter(':last-child').addClass(LAST);\n }\n function storeItemSelectEventHandler(element, options) {\n var selectHandler = getItemSelectEventHandler(options);\n if (selectHandler) {\n setItemData(element, selectHandler);\n }\n if (options.items) {\n $(element).children('ul').children('li').each(function (i) {\n storeItemSelectEventHandler(this, options.items[i]);\n });\n }\n }\n function setItemData(element, selectHandler) {\n $(element).children('.k-link').data({ selectHandler: selectHandler });\n }\n function getItemSelectEventHandler(options) {\n var selectHandler = options.select, isFunction = kendo.isFunction;\n if (selectHandler && isFunction(selectHandler)) {\n return selectHandler;\n }\n return null;\n }\n function popupOpenerSelector(id) {\n return id ? 'li[data-groupparent=\\'' + id + '\\']' : 'li[data-groupparent]';\n }\n function popupGroupSelector(id) {\n return id ? 'ul[data-group=\\'' + id + '\\']' : 'ul[data-group]';\n }\n function getChildPopups(currentPopup, overflowWrapper) {\n var childPopupOpener = currentPopup.find(popupOpenerSelector());\n var result = [];\n childPopupOpener.each(function (i, opener) {\n opener = $(opener);\n var popupId = opener.data(POPUP_OPENER_ATTR);\n var popup = currentPopup;\n while (popupId) {\n popup = overflowWrapper.find(popupGroupSelector(popupId) + ':visible');\n if (popup.length) {\n result.push(popup);\n }\n opener = popup.find(popupOpenerSelector());\n popupId = opener.data(POPUP_OPENER_ATTR);\n }\n });\n return result;\n }\n function popupParentItem(popupElement, overflowWrapper) {\n var popupId = popupElement.data(POPUP_ID_ATTR);\n return popupId ? overflowWrapper.find(popupOpenerSelector(popupId)) : $([]);\n }\n function itemPopup(item, overflowWrapper) {\n var popupId = item.data(POPUP_OPENER_ATTR);\n return popupId ? overflowWrapper.children(animationContainerSelector).children(popupGroupSelector(popupId)) : $([]);\n }\n function overflowMenuParents(current, overflowWrapper) {\n var parents = [];\n var getParents = function (item) {\n while (item.parentNode && !overflowWrapper.is(item.parentNode)) {\n parents.push(item.parentNode);\n item = item.parentNode;\n }\n };\n var elem = current[0] || current;\n getParents(elem);\n var last = parents[parents.length - 1];\n while ($(last).is(animationContainerSelector)) {\n var popupElement = $(last).children('ul');\n elem = popupParentItem(popupElement, overflowWrapper)[0];\n if (!elem) {\n break;\n }\n parents.push(elem);\n getParents(elem);\n last = parents[parents.length - 1];\n }\n return parents;\n }\n function mousewheelDelta(e) {\n var delta = 0;\n if (e.wheelDelta) {\n delta = -e.wheelDelta / 120;\n delta = delta > 0 ? Math.ceil(delta) : Math.floor(delta);\n }\n if (e.detail) {\n delta = Math.round(e.detail / 3);\n }\n return delta;\n }\n function parentsScroll(current, scrollDirection) {\n var scroll = 0;\n var parent = current.parentNode;\n while (parent && !isNaN(parent[scrollDirection])) {\n scroll += parent[scrollDirection];\n parent = parent.parentNode;\n }\n return scroll;\n }\n function isPointerTouch(e) {\n return allPointers && e.originalEvent.pointerType in touchPointerTypes;\n }\n function isTouch(e) {\n var ev = e.originalEvent;\n return touch && /touch/i.test(ev.type || '');\n }\n function removeSpacesBetweenItems(ul) {\n ul.contents().filter(function () {\n return this.nodeName != 'LI';\n }).remove();\n }\n var Menu = Widget.extend({\n init: function (element, options) {\n var that = this;\n Widget.fn.init.call(that, element, options);\n element = that.wrapper = that.element;\n options = that.options;\n that._initData(options);\n that._updateClasses();\n that._animations(options);\n that.nextItemZIndex = 100;\n that._tabindex();\n that._initOverflow(options);\n that._attachMenuEventsHandlers();\n if (options.openOnClick) {\n that.clicked = false;\n }\n element.attr('role', 'menubar');\n if (element[0].id) {\n that._ariaId = kendo.format('{0}_mn_active', element[0].id);\n }\n kendo.notify(that);\n },\n events: [\n OPEN,\n CLOSE,\n ACTIVATE,\n DEACTIVATE,\n SELECT\n ],\n options: {\n name: 'Menu',\n animation: {\n open: { duration: 200 },\n close: { duration: 100 }\n },\n orientation: 'horizontal',\n direction: 'default',\n openOnClick: false,\n closeOnClick: true,\n hoverDelay: 100,\n scrollable: false,\n popupCollision: undefined\n },\n _initData: function (options) {\n var that = this;\n if (options.dataSource) {\n that.angular('cleanup', function () {\n return { elements: that.element.children() };\n });\n that.element.empty();\n that.append(options.dataSource, that.element);\n that.angular('compile', function () {\n return { elements: that.element.children() };\n });\n }\n },\n _attachMenuEventsHandlers: function () {\n var that = this;\n var element = that.element;\n var options = that.options;\n var overflowWrapper = that._overflowWrapper();\n (overflowWrapper || element).on(POINTERDOWN, itemSelector, proxy(that._focusHandler, that)).on(CLICK + NS, disabledSelector, false).on(CLICK + NS, itemSelector, proxy(that._click, that)).on(POINTERDOWN + ' ' + MOUSEDOWN + NS, '.k-content', proxy(that._preventClose, that)).on(MOUSEENTER + NS, itemSelector, proxy(that._mouseenter, that)).on(MOUSELEAVE + NS, itemSelector, proxy(that._mouseleave, that)).on(MOUSEENTER + NS + ' ' + MOUSELEAVE + NS + ' ' + MOUSEDOWN + NS + ' ' + CLICK + NS, linkSelector, proxy(that._toggleHover, that));\n element.on('keydown' + NS, proxy(that._keydown, that)).on('focus' + NS, proxy(that._focus, that)).on('focus' + NS, '.k-content', proxy(that._focus, that)).on('blur' + NS, proxy(that._removeHoverItem, that)).on('blur' + NS, '[tabindex]', proxy(that._checkActiveElement, that));\n if (overflowWrapper) {\n overflowWrapper.on(MOUSELEAVE + NS, popupSelector, proxy(that._mouseleavePopup, that)).on(MOUSEENTER + NS, popupSelector, proxy(that._mouseenterPopup, that));\n }\n if (options.openOnClick) {\n that._documentClickHandler = proxy(that._documentClick, that);\n $(document).click(that._documentClickHandler);\n }\n },\n _detachMenuEventsHandlers: function () {\n var that = this;\n var overflowWrapper = that._overflowWrapper();\n if (overflowWrapper) {\n overflowWrapper.off(NS);\n }\n that.element.off(NS);\n if (that._documentClickHandler) {\n $(document).unbind('click', that._documentClickHandler);\n }\n },\n _initOverflow: function (options) {\n var that = this;\n var isHorizontal = options.orientation == 'horizontal';\n var backwardBtn, forwardBtn;\n if (options.scrollable) {\n that._openedPopups = {};\n that._scrollWrapper = that.element.wrap('
    ').parent();\n if (isHorizontal) {\n removeSpacesBetweenItems(that.element);\n }\n backwardBtn = $(templates.scrollButton({ direction: isHorizontal ? 'left' : 'up' }));\n forwardBtn = $(templates.scrollButton({ direction: isHorizontal ? 'right' : 'down' }));\n backwardBtn.add(forwardBtn).appendTo(that._scrollWrapper);\n that._initScrolling(that.element, backwardBtn, forwardBtn, isHorizontal);\n var initialWidth = that.element.outerWidth();\n var initialCssWidth = that.element[0].style.width;\n initialCssWidth = initialCssWidth === 'auto' ? '' : initialCssWidth;\n if (isHorizontal) {\n $(window).on(RESIZE, kendo.throttle(function () {\n that._setOverflowWrapperWidth(initialWidth, initialCssWidth);\n that._toggleScrollButtons(that.element, backwardBtn, forwardBtn, isHorizontal);\n }, 100));\n }\n that._setOverflowWrapperWidth(initialWidth, initialCssWidth);\n that._toggleScrollButtons(that.element, backwardBtn, forwardBtn, isHorizontal);\n }\n },\n _overflowWrapper: function () {\n return this._scrollWrapper || this._popupsWrapper;\n },\n _setOverflowWrapperWidth: function (initialWidth, initialCssWidth) {\n var that = this;\n var wrapperCssWidth = that._scrollWrapper.css('width');\n that._scrollWrapper.css({ width: '' });\n var wrapperWidth = that._scrollWrapper.outerWidth();\n that._scrollWrapper.css({ width: wrapperCssWidth });\n var menuWidth = that.element.outerWidth();\n var borders = that.element[0].offsetWidth - that.element[0].clientWidth;\n if (menuWidth != wrapperWidth) {\n var width = initialCssWidth ? Math.min(initialWidth, wrapperWidth) : wrapperWidth;\n that.element.width(width - borders);\n that._scrollWrapper.width(width);\n }\n },\n _reinitOverflow: function (options) {\n var that = this;\n var overflowChanged = options.scrollable && !that.options.scrollable || !options.scrollable && that.options.scrollable || options.scrollable && that.options.scrollable && options.scrollable.distance != that.options.scrollable.distance || options.orientation != that.options.orientation;\n if (overflowChanged) {\n that._detachMenuEventsHandlers();\n that._destroyOverflow();\n that._initOverflow(options);\n that._attachMenuEventsHandlers();\n }\n },\n _destroyOverflow: function () {\n var that = this;\n var overflowWrapper = that._overflowWrapper();\n if (overflowWrapper) {\n overflowWrapper.off(NS);\n overflowWrapper.find(scrollButtonSelector).off(NS).remove();\n overflowWrapper.children(animationContainerSelector).each(function (i, popupWrapper) {\n var ul = $(popupWrapper).children(groupSelector);\n ul.off(MOUSEWHEEL);\n var popupParentLi = popupParentItem(ul, overflowWrapper);\n if (popupParentLi.length) {\n popupParentLi.append(popupWrapper);\n }\n });\n overflowWrapper.find(popupOpenerSelector()).removeAttr('data-groupparent');\n overflowWrapper.find(popupGroupSelector()).removeAttr('data-group');\n that.element.off(MOUSEWHEEL);\n $(window).off(RESIZE);\n overflowWrapper.contents().unwrap();\n that._scrollWrapper = that._popupsWrapper = that._openedPopups = undefined;\n }\n },\n _initScrolling: function (scrollElement, backwardBtn, forwardBtn, isHorizontal) {\n var that = this;\n var scrollable = that.options.scrollable;\n var distance = $.isNumeric(scrollable.distance) ? scrollable.distance : SCROLLSPEED;\n var mouseWheelDistance = distance / 2;\n var backward = '-=' + distance;\n var forward = '+=' + distance;\n var backwardDouble = '-=' + distance * 2;\n var forwardDouble = '+=' + distance * 2;\n var scrolling = false;\n var touchEvents = false;\n var scroll = function (value) {\n var scrollValue = isHorizontal ? { 'scrollLeft': value } : { 'scrollTop': value };\n scrollElement.finish().animate(scrollValue, 'fast', 'linear', function () {\n if (scrolling) {\n scroll(value);\n }\n });\n that._toggleScrollButtons(scrollElement, backwardBtn, forwardBtn, isHorizontal);\n };\n var mouseenterHandler = function (e) {\n if (!scrolling && !touchEvents) {\n scroll(e.data.direction);\n scrolling = true;\n }\n };\n var mousedownHandler = function (e) {\n var scrollValue = isHorizontal ? { 'scrollLeft': e.data.direction } : { 'scrollTop': e.data.direction };\n touchEvents = isTouch(e) || isPointerTouch(e);\n scrollElement.stop().animate(scrollValue, 'fast', 'linear', function () {\n if (!touchEvents) {\n $(e.currentTarget).trigger(MOUSEENTER);\n } else {\n that._toggleScrollButtons(scrollElement, backwardBtn, forwardBtn, isHorizontal);\n scrolling = true;\n }\n });\n scrolling = false;\n e.stopPropagation();\n e.preventDefault();\n };\n backwardBtn.on(MOUSEENTER + NS, { direction: backward }, mouseenterHandler).on(kendo.eventMap.down + NS, { direction: backwardDouble }, mousedownHandler);\n forwardBtn.on(MOUSEENTER + NS, { direction: forward }, mouseenterHandler).on(kendo.eventMap.down + NS, { direction: forwardDouble }, mousedownHandler);\n backwardBtn.add(forwardBtn).on(MOUSELEAVE + NS, function () {\n scrollElement.stop();\n scrolling = false;\n that._toggleScrollButtons(scrollElement, backwardBtn, forwardBtn, isHorizontal);\n });\n scrollElement.on(MOUSEWHEEL, function (e) {\n if (!e.ctrlKey && !e.shiftKey && !e.altKey) {\n var wheelDelta = mousewheelDelta(e.originalEvent);\n var scrollSpeed = Math.abs(wheelDelta) * mouseWheelDistance;\n var value = (wheelDelta > 0 ? '+=' : '-=') + scrollSpeed;\n var scrollValue = isHorizontal ? { 'scrollLeft': value } : { 'scrollTop': value };\n that._closeChildPopups(scrollElement);\n scrollElement.finish().animate(scrollValue, 'fast', 'linear', function () {\n that._toggleScrollButtons(scrollElement, backwardBtn, forwardBtn, isHorizontal);\n });\n e.preventDefault();\n }\n });\n },\n _toggleScrollButtons: function (scrollElement, backwardBtn, forwardBtn, horizontal) {\n var currentScroll = horizontal ? scrollElement.scrollLeft() : scrollElement.scrollTop();\n var scrollSize = horizontal ? SCROLLWIDTH : SCROLLHEIGHT;\n var offset = horizontal ? OFFSETWIDTH : OFFSETHEIGHT;\n backwardBtn.toggle(currentScroll !== 0);\n forwardBtn.toggle(currentScroll < scrollElement[0][scrollSize] - scrollElement[0][offset] - 1);\n },\n setOptions: function (options) {\n var animation = this.options.animation;\n this._animations(options);\n options.animation = extend(true, animation, options.animation);\n if ('dataSource' in options) {\n this._initData(options);\n }\n this._updateClasses();\n this._reinitOverflow(options);\n Widget.fn.setOptions.call(this, options);\n },\n destroy: function () {\n var that = this;\n Widget.fn.destroy.call(that);\n that._detachMenuEventsHandlers();\n that._destroyOverflow();\n kendo.destroy(that.element);\n },\n enable: function (element, enable) {\n this._toggleDisabled(element, enable !== false);\n return this;\n },\n disable: function (element) {\n this._toggleDisabled(element, false);\n return this;\n },\n append: function (item, referenceItem) {\n referenceItem = this.element.find(referenceItem);\n var inserted = this._insert(item, referenceItem, referenceItem.length ? referenceItem.find('> .k-menu-group, > .k-animation-container > .k-menu-group') : null);\n each(inserted.items, function (i) {\n inserted.group.append(this);\n updateArrow(this);\n storeItemSelectEventHandler(this, item[i] || item);\n });\n updateArrow(referenceItem);\n updateFirstLast(inserted.group.find('.k-first, .k-last').add(inserted.items));\n return this;\n },\n insertBefore: function (item, referenceItem) {\n referenceItem = this.element.find(referenceItem);\n var inserted = this._insert(item, referenceItem, referenceItem.parent());\n each(inserted.items, function (i) {\n referenceItem.before(this);\n updateArrow(this);\n updateFirstLast(this);\n storeItemSelectEventHandler(this, item[i] || item);\n });\n updateFirstLast(referenceItem);\n return this;\n },\n insertAfter: function (item, referenceItem) {\n referenceItem = this.element.find(referenceItem);\n var inserted = this._insert(item, referenceItem, referenceItem.parent());\n each(inserted.items, function (i) {\n referenceItem.after(this);\n updateArrow(this);\n updateFirstLast(this);\n storeItemSelectEventHandler(this, item[i] || item);\n });\n updateFirstLast(referenceItem);\n return this;\n },\n _insert: function (item, referenceItem, parent) {\n var that = this, items, groups;\n if (!referenceItem || !referenceItem.length) {\n parent = that.element;\n }\n var plain = $.isPlainObject(item), groupData = {\n firstLevel: parent.hasClass(MENU),\n horizontal: parent.hasClass(MENU + '-horizontal'),\n expanded: true,\n length: parent.children().length\n };\n if (referenceItem && !parent.length) {\n parent = $(Menu.renderGroup({ group: groupData })).appendTo(referenceItem);\n }\n if (plain || $.isArray(item)) {\n items = $($.map(plain ? [item] : item, function (value, idx) {\n if (typeof value === 'string') {\n return $(value).get();\n } else {\n return $(Menu.renderItem({\n group: groupData,\n item: extend(value, { index: idx })\n })).get();\n }\n }));\n } else {\n if (typeof item == 'string' && item.charAt(0) != '<') {\n items = that.element.find(item);\n } else {\n items = $(item);\n }\n groups = items.find('> ul').addClass('k-menu-group').attr('role', 'menu');\n items = items.filter('li');\n items.add(groups.find('> li')).each(function () {\n updateItemClasses(this);\n });\n }\n return {\n items: items,\n group: parent\n };\n },\n remove: function (element) {\n element = this.element.find(element);\n var that = this, parent = element.parentsUntil(that.element, allItemsSelector), group = element.parent('ul:not(.k-menu)');\n element.remove();\n if (group && !group.children(allItemsSelector).length) {\n var container = group.parent(animationContainerSelector);\n if (container.length) {\n container.remove();\n } else {\n group.remove();\n }\n }\n if (parent.length) {\n parent = parent.eq(0);\n updateArrow(parent);\n updateFirstLast(parent);\n }\n return that;\n },\n open: function (element) {\n var that = this;\n var options = that.options;\n var horizontal = options.orientation == 'horizontal';\n var direction = options.direction;\n var isRtl = kendo.support.isRtl(that.wrapper);\n var overflowWrapper = that._overflowWrapper();\n element = (overflowWrapper || that.element).find(element);\n if (/^(top|bottom|default)$/.test(direction)) {\n if (isRtl) {\n direction = horizontal ? (direction + ' left').replace('default', 'bottom') : 'left';\n } else {\n direction = horizontal ? (direction + ' right').replace('default', 'bottom') : 'right';\n }\n }\n var visiblePopups = '>.k-popup:visible,>.k-animation-container>.k-popup:visible';\n var closePopup = function () {\n var popup = $(this).data(KENDOPOPUP);\n if (popup) {\n popup.close(true);\n }\n };\n element.siblings().find(visiblePopups).each(closePopup);\n if (overflowWrapper) {\n element.find(visiblePopups).each(closePopup);\n }\n element.each(function () {\n var li = $(this);\n clearTimeout(li.data(TIMER));\n li.data(TIMER, setTimeout(function () {\n var ul = li.find('.k-menu-group:first:hidden');\n var popup;\n var overflowPopup;\n if (!ul[0] && overflowWrapper) {\n overflowPopup = that._getPopup(li);\n ul = overflowPopup && overflowPopup.element;\n }\n if (ul.is(':visible')) {\n return;\n }\n if (ul[0] && that._triggerEvent({\n item: li[0],\n type: OPEN\n }) === false) {\n if (!ul.find('.k-menu-group')[0] && ul.children('.k-item').length > 1) {\n var windowHeight = $(window).height(), setScrolling = function () {\n ul.css({\n maxHeight: windowHeight - (kendo._outerHeight(ul) - ul.height()) - kendo.getShadows(ul).bottom,\n overflow: 'auto'\n });\n };\n if (kendo.support.browser.msie && kendo.support.browser.version <= 7) {\n setTimeout(setScrolling, 0);\n } else {\n setScrolling();\n }\n } else {\n ul.css({\n maxHeight: '',\n overflow: ''\n });\n }\n li.data(ZINDEX, li.css(ZINDEX));\n var nextZindex = that.nextItemZIndex++;\n li.css(ZINDEX, nextZindex);\n if (that.options.scrollable) {\n li.parent().siblings(scrollButtonSelector).css({ zIndex: ++nextZindex });\n }\n popup = ul.data(KENDOPOPUP);\n var root = li.parent().hasClass(MENU), parentHorizontal = root && horizontal, directions = parseDirection(direction, root, isRtl), effects = options.animation.open.effects, openEffects = effects !== undefined ? effects : 'slideIn:' + getEffectDirection(direction, root);\n if (!popup) {\n popup = ul.kendoPopup({\n activate: function () {\n that._triggerEvent({\n item: this.wrapper.parent(),\n type: ACTIVATE\n });\n },\n deactivate: function (e) {\n e.sender.element.removeData('targetTransform').css({ opacity: '' });\n that._triggerEvent({\n item: this.wrapper.parent(),\n type: DEACTIVATE\n });\n },\n origin: directions.origin,\n position: directions.position,\n collision: options.popupCollision !== undefined ? options.popupCollision : parentHorizontal ? 'fit' : 'fit flip',\n anchor: li,\n appendTo: overflowWrapper || li,\n animation: {\n open: extend(true, { effects: openEffects }, options.animation.open),\n close: options.animation.close\n },\n open: proxy(that._popupOpen, that),\n close: function (e) {\n var li = e.sender.wrapper.parent();\n if (overflowWrapper) {\n var popupId = e.sender.element.data(POPUP_ID_ATTR);\n if (popupId) {\n li = (overflowWrapper || that.element).find(popupOpenerSelector(popupId));\n }\n e.sender.wrapper.children(scrollButtonSelector).hide();\n }\n if (!that._triggerEvent({\n item: li[0],\n type: CLOSE\n })) {\n li.css(ZINDEX, li.data(ZINDEX));\n li.removeData(ZINDEX);\n if (that.options.scrollable) {\n li.parent().siblings(scrollButtonSelector).css({ zIndex: '' });\n }\n if (touch || allPointers) {\n li.removeClass(HOVERSTATE);\n that._removeHoverItem();\n }\n } else {\n e.preventDefault();\n }\n }\n }).data(KENDOPOPUP);\n } else {\n popup = ul.data(KENDOPOPUP);\n popup.options.origin = directions.origin;\n popup.options.position = directions.position;\n popup.options.animation.open.effects = openEffects;\n }\n ul.removeAttr('aria-hidden');\n that._configurePopupOverflow(popup, li);\n popup.open();\n that._initPopupScrolling(popup);\n }\n }, that.options.hoverDelay));\n });\n return that;\n },\n _configurePopupOverflow: function (popup, popupOpener) {\n var that = this;\n if (that.options.scrollable) {\n that._wrapPopupElement(popup);\n if (!popupOpener.attr('data-groupparent')) {\n var groupId = new Date().getTime();\n popupOpener.attr('data-groupparent', groupId);\n popup.element.attr('data-group', groupId);\n }\n }\n },\n _wrapPopupElement: function (popup) {\n if (!popup.element.parent().is(animationContainerSelector)) {\n popup.wrapper = kendo.wrap(popup.element, popup.options.autosize).css({\n overflow: 'hidden',\n display: 'block',\n position: 'absolute'\n });\n }\n },\n _initPopupScrolling: function (popup, isHorizontal, skipMouseEvents) {\n var that = this;\n if (that.options.scrollable && popup.element[0].scrollHeight > popup.element[0].offsetHeight) {\n that._initPopupScrollButtons(popup, isHorizontal, skipMouseEvents);\n }\n },\n _initPopupScrollButtons: function (popup, isHorizontal, skipMouseEvents) {\n var that = this;\n var scrollButtons = popup.wrapper.children(scrollButtonSelector);\n var animation = that.options.animation;\n var timeout = (animation && animation.open && animation.open.duration || 0) + DELAY;\n setTimeout(function () {\n if (!scrollButtons.length) {\n var backwardBtn = $(templates.scrollButton({ direction: isHorizontal ? 'left' : 'up' }));\n var forwardBtn = $(templates.scrollButton({ direction: isHorizontal ? 'right' : 'down' }));\n scrollButtons = backwardBtn.add(forwardBtn).appendTo(popup.wrapper);\n that._initScrolling(popup.element, backwardBtn, forwardBtn, isHorizontal);\n if (!skipMouseEvents) {\n scrollButtons.on(MOUSEENTER + NS, function () {\n var overflowWrapper = that._overflowWrapper();\n $(getChildPopups(popup.element, overflowWrapper)).each(function (i, p) {\n var popupOpener = overflowWrapper.find(popupOpenerSelector(p.data(POPUP_ID_ATTR)));\n that.close(popupOpener);\n });\n }).on(MOUSELEAVE + NS, function () {\n setTimeout(function () {\n if ($.isEmptyObject(that._openedPopups)) {\n that._closeParentPopups(popup.element);\n }\n }, DELAY);\n });\n }\n }\n that._toggleScrollButtons(popup.element, scrollButtons.first(), scrollButtons.last(), isHorizontal);\n }, timeout);\n },\n _popupOpen: function (e) {\n e.sender.element.children('.' + FOCUSEDSTATE).removeClass(FOCUSEDSTATE);\n if (this.options.scrollable) {\n this._setPopupHeight(e.sender);\n }\n },\n _setPopupHeight: function (popup, isFixed) {\n var popupElement = popup.element;\n var popups = popupElement.add(popupElement.parent(animationContainerSelector));\n popups.height(popupElement.hasClass(MENU) && this._initialHeight || '');\n var location = popup._location(isFixed);\n var windowHeight = $(window).height();\n var popupOuterHeight = location.height;\n var popupOffsetTop = isFixed ? 0 : Math.max(location.top, 0);\n var scrollTop = isFixed ? 0 : parentsScroll(this._overflowWrapper()[0], 'scrollTop');\n var bottomScrollbar = window.innerHeight - windowHeight;\n var maxHeight = windowHeight - kendo.getShadows(popupElement).bottom + bottomScrollbar;\n var canFit = maxHeight + scrollTop > popupOuterHeight + popupOffsetTop;\n if (!canFit) {\n var height = Math.min(maxHeight, maxHeight - popupOffsetTop + scrollTop);\n popups.css({\n overflow: 'hidden',\n height: height + 'px'\n });\n }\n },\n close: function (items, dontClearClose) {\n var that = this;\n var overflowWrapper = that._overflowWrapper();\n var element = overflowWrapper || that.element;\n items = element.find(items);\n if (!items.length) {\n items = element.find('>.k-item');\n }\n var hasChildPopupsHovered = function (currentPopup) {\n var result = false;\n if ($.isEmptyObject(that._openedPopups)) {\n return result;\n }\n $(getChildPopups(currentPopup, overflowWrapper)).each(function (i, popup) {\n result = !!that._openedPopups[popup.data(POPUP_ID_ATTR).toString()];\n return !result;\n });\n return result;\n };\n var isPopupMouseLeaved = function (opener) {\n var groupId = opener.data(POPUP_OPENER_ATTR);\n return !overflowWrapper || !groupId || !that._openedPopups[groupId.toString()];\n };\n items.each(function () {\n var li = $(this);\n if (!dontClearClose && that._isRootItem(li)) {\n that.clicked = false;\n }\n clearTimeout(li.data(TIMER));\n li.data(TIMER, setTimeout(function () {\n var popup = that._getPopup(li);\n if (popup && (isPopupMouseLeaved(li) || that._forceClose)) {\n if (!that._forceClose && hasChildPopupsHovered(popup.element)) {\n return;\n }\n popup.close();\n popup.element.attr('aria-hidden', true);\n if (overflowWrapper) {\n if (that._forceClose && items.last().is(li[0])) {\n delete that._forceClose;\n }\n }\n }\n }, that.options.hoverDelay));\n });\n return that;\n },\n _getPopup: function (li) {\n var that = this;\n var popup = li.find('.k-menu-group:not(.k-list-container):not(.k-calendar-container):first:visible').data(KENDOPOPUP);\n var overflowWrapper = that._overflowWrapper();\n if (!popup && overflowWrapper) {\n var groupId = li.data(POPUP_OPENER_ATTR);\n if (groupId) {\n var popupElement = overflowWrapper.find(popupGroupSelector(groupId));\n popup = popupElement.data(KENDOPOPUP);\n }\n }\n return popup;\n },\n _toggleDisabled: function (items, enable) {\n this.element.find(items).each(function () {\n $(this).toggleClass(DEFAULTSTATE, enable).toggleClass(DISABLEDSTATE, !enable).attr('aria-disabled', !enable);\n });\n },\n _toggleHover: function (e) {\n var target = $(kendo.eventTarget(e) || e.target).closest(allItemsSelector), isEnter = e.type == MOUSEENTER || MOUSEDOWN.indexOf(e.type) !== -1;\n if (!target.parents('li.' + DISABLEDSTATE).length) {\n target.toggleClass(HOVERSTATE, isEnter || e.type == 'mousedown' || e.type == 'click');\n }\n this._removeHoverItem();\n },\n _preventClose: function () {\n if (!this.options.closeOnClick) {\n this._closurePrevented = true;\n }\n },\n _checkActiveElement: function (e) {\n var that = this, hoverItem = $(e ? e.currentTarget : this._hoverItem()), target = that._findRootParent(hoverItem)[0];\n if (!this._closurePrevented) {\n setTimeout(function () {\n if (!document.hasFocus() || !contains(target, kendo._activeElement()) && e && !contains(target, e.currentTarget)) {\n that.close(target);\n }\n }, 0);\n }\n this._closurePrevented = false;\n },\n _removeHoverItem: function () {\n var oldHoverItem = this._hoverItem();\n if (oldHoverItem && oldHoverItem.hasClass(FOCUSEDSTATE)) {\n oldHoverItem.removeClass(FOCUSEDSTATE);\n this._oldHoverItem = null;\n }\n },\n _updateClasses: function () {\n var element = this.element, nonContentGroupsSelector = '.k-menu-init div ul', items;\n element.removeClass('k-menu-horizontal k-menu-vertical');\n element.addClass('k-widget k-reset k-header k-menu-init ' + MENU).addClass(MENU + '-' + this.options.orientation);\n element.find('li > ul').filter(function () {\n return !kendo.support.matchesSelector.call(this, nonContentGroupsSelector);\n }).addClass('k-group k-menu-group').attr('role', 'menu').attr('aria-hidden', element.is(':visible')).end().find('li > div').addClass('k-content').attr('tabindex', '-1');\n items = element.find('> li,.k-menu-group > li');\n element.removeClass('k-menu-init');\n items.each(function () {\n updateItemClasses(this);\n });\n },\n _mouseenter: function (e) {\n var that = this;\n var element = $(e.currentTarget);\n var hasChildren = that._itemHasChildren(element);\n var popupId = element.data(POPUP_OPENER_ATTR) || element.parent().data(POPUP_ID_ATTR);\n var pointerTouch = isPointerTouch(e);\n if (popupId) {\n that._openedPopups[popupId.toString()] = true;\n }\n if (e.delegateTarget != element.parents(menuSelector)[0] && e.delegateTarget != element.parents('.k-menu-scroll-wrapper,.k-popups-wrapper')[0]) {\n return;\n }\n if ((!that.options.openOnClick || that.clicked) && !touch && !(pointerTouch && that._isRootItem(element.closest(allItemsSelector)))) {\n if (!contains(e.currentTarget, e.relatedTarget) && hasChildren) {\n that.open(element);\n }\n }\n if (that.options.openOnClick && that.clicked || touch) {\n element.siblings().each(proxy(function (_, sibling) {\n that.close(sibling, true);\n }, that));\n }\n },\n _mouseleave: function (e) {\n var that = this;\n var element = $(e.currentTarget);\n var popupOpener = element.data(POPUP_OPENER_ATTR);\n var hasChildren = element.children(animationContainerSelector).length || element.children(groupSelector).length || popupOpener;\n var $window = $(window);\n if (popupOpener) {\n delete that._openedPopups[popupOpener.toString()];\n }\n if (element.parentsUntil(animationContainerSelector, '.k-list-container,.k-calendar-container')[0]) {\n e.stopImmediatePropagation();\n return;\n }\n if (!that.options.openOnClick && !touch && !isPointerTouch(e) && !contains(e.currentTarget, e.relatedTarget || e.target) && hasChildren && !contains(e.currentTarget, kendo._activeElement())) {\n that.close(element);\n return;\n }\n if (!e.toElement && !e.relatedTarget || e.clientX < 0 || e.clientY < 0 || e.clientY > $window.height() || e.clientX > $window.width()) {\n that.close(element);\n }\n },\n _mouseenterPopup: function (e) {\n var that = this;\n var popupElement = $(e.currentTarget);\n if (popupElement.parent().is(animationContainerSelector)) {\n return;\n }\n popupElement = popupElement.children('ul');\n var popupId = popupElement.data(POPUP_ID_ATTR);\n if (popupId) {\n that._openedPopups[popupId.toString()] = true;\n }\n },\n _mouseleavePopup: function (e) {\n var that = this;\n var popupElement = $(e.currentTarget);\n if (!isPointerTouch(e) && popupElement.is(animationContainerSelector)) {\n that._closePopups(popupElement.children('ul'));\n }\n },\n _closePopups: function (rootPopup) {\n var that = this;\n var overflowWrapper = that._overflowWrapper();\n var popupId = rootPopup.data(POPUP_ID_ATTR);\n if (popupId) {\n delete that._openedPopups[popupId.toString()];\n var groupParent = overflowWrapper.find(popupOpenerSelector(popupId));\n setTimeout(function () {\n if (that.options.openOnClick) {\n that._closeChildPopups(rootPopup);\n } else {\n if ($.isEmptyObject(that._openedPopups)) {\n var innerPopup = that._innerPopup(rootPopup);\n that._closeParentPopups(innerPopup);\n } else {\n that.close(groupParent, true);\n }\n }\n }, 0);\n }\n },\n _closeChildPopups: function (current) {\n var that = this;\n var overflowWrapper = that._overflowWrapper();\n $(getChildPopups(current, overflowWrapper)).each(function () {\n var popupOpener = overflowWrapper.find(popupOpenerSelector(this.data(POPUP_ID_ATTR)));\n that.close(popupOpener, true);\n });\n },\n _innerPopup: function (current) {\n var overflowWrapper = this._overflowWrapper();\n var popups = getChildPopups(current, overflowWrapper);\n return popups[popups.length - 1] || current;\n },\n _closeParentPopups: function (current) {\n var that = this;\n var overflowWrapper = that._overflowWrapper();\n var popupId = current.data(POPUP_ID_ATTR);\n var popupOpener = overflowWrapper.find(popupOpenerSelector(popupId));\n popupId = popupOpener.parent().data(POPUP_ID_ATTR);\n that.close(popupOpener, true);\n while (popupId && !that._openedPopups[popupId]) {\n if (popupOpener.parent().is(menuSelector)) {\n break;\n }\n popupOpener = overflowWrapper.find(popupOpenerSelector(popupId));\n that.close(popupOpener, true);\n popupId = popupOpener.parent().data(POPUP_ID_ATTR);\n }\n },\n _click: function (e) {\n var that = this, openHandle, options = that.options, target = $(kendo.eventTarget(e)), targetElement = target[0], nodeName = target[0] ? target[0].nodeName.toUpperCase() : '', formNode = nodeName == 'INPUT' || nodeName == 'SELECT' || nodeName == 'BUTTON' || nodeName == 'LABEL', link = target.closest('.' + LINK), element = target.closest(allItemsSelector), itemElement = element[0], href = link.attr('href'), childGroup, childGroupVisible, targetHref = target.attr('href'), sampleHref = $('').attr('href'), isLink = !!href && href !== sampleHref, isLocalLink = isLink && !!href.match(/^#/), isTargetLink = !!targetHref && targetHref !== sampleHref, overflowWrapper = that._overflowWrapper(), shouldCloseTheRootItem;\n while (targetElement && targetElement.parentNode != itemElement) {\n targetElement = targetElement.parentNode;\n }\n if ($(targetElement).is(templateSelector)) {\n return;\n }\n if (element.hasClass(DISABLEDSTATE)) {\n e.preventDefault();\n return;\n }\n if (!e.handled && that._triggerSelect(target, itemElement) && !formNode) {\n e.preventDefault();\n }\n e.handled = true;\n childGroup = element.children(popupSelector);\n if (overflowWrapper) {\n var childPopupId = element.data(POPUP_OPENER_ATTR);\n if (childPopupId) {\n childGroup = overflowWrapper.find(popupGroupSelector(childPopupId));\n }\n }\n childGroupVisible = childGroup.is(':visible');\n shouldCloseTheRootItem = options.openOnClick && childGroupVisible && that._isRootItem(element);\n if (options.closeOnClick && (!isLink || isLocalLink) && (!childGroup.length || shouldCloseTheRootItem)) {\n element.removeClass(HOVERSTATE).css('height');\n that._oldHoverItem = that._findRootParent(element);\n var item = that._parentsUntil(link, that.element, allItemsSelector);\n that._forceClose = !!overflowWrapper;\n that.close(item);\n that.clicked = false;\n if ('MSPointerUp'.indexOf(e.type) != -1) {\n e.preventDefault();\n }\n return;\n }\n if (isLink && e.enterKey) {\n link[0].click();\n }\n if ((!that._isRootItem(element) || !options.openOnClick) && !kendo.support.touch && !(allPointers && that._isRootItem(element.closest(allItemsSelector)))) {\n return;\n }\n if (!isLink && !formNode && !isTargetLink) {\n e.preventDefault();\n }\n that.clicked = true;\n openHandle = childGroup.is(':visible') ? CLOSE : OPEN;\n if (!options.closeOnClick && openHandle == CLOSE) {\n return;\n }\n that[openHandle](element);\n },\n _parentsUntil: function (context, top, selector) {\n var overflowWrapper = this._overflowWrapper();\n if (!overflowWrapper) {\n return context.parentsUntil(top, selector);\n } else {\n var parents = overflowMenuParents(context, overflowWrapper);\n var result = [];\n $(parents).each(function () {\n var parent = $(this);\n if (parent.is(top)) {\n return false;\n }\n if (parent.is(selector)) {\n result.push(this);\n }\n });\n return $(result);\n }\n },\n _triggerSelect: function (target, itemElement) {\n var selectHandler = target.data('selectHandler'), itemSelectEventData;\n if (selectHandler) {\n itemSelectEventData = this._getEventData(target);\n selectHandler.call(this, itemSelectEventData);\n }\n var isSelectItemDefaultPrevented = itemSelectEventData && itemSelectEventData.isDefaultPrevented();\n var isSelectDefaultPrevented = this._triggerEvent({\n item: itemElement,\n type: SELECT\n });\n return isSelectItemDefaultPrevented || isSelectDefaultPrevented;\n },\n _getEventData: function (target) {\n var eventData = {\n sender: this,\n target: target,\n _defaultPrevented: false,\n preventDefault: function () {\n this._defaultPrevented = true;\n },\n isDefaultPrevented: function () {\n return this._defaultPrevented;\n }\n };\n return eventData;\n },\n _documentClick: function (e) {\n var that = this;\n if (contains((that._overflowWrapper() || that.element)[0], e.target)) {\n return;\n }\n that.clicked = false;\n },\n _focus: function (e) {\n var that = this, target = e.target, hoverItem = that._hoverItem(), active = activeElement();\n if (target != that.wrapper[0] && !$(target).is(':kendoFocusable')) {\n e.stopPropagation();\n $(target).closest('.k-content').closest('.k-menu-group').closest('.k-item').addClass(FOCUSEDSTATE);\n that.wrapper.focus();\n return;\n }\n if (active === e.currentTarget) {\n if (hoverItem.length) {\n that._moveHover([], hoverItem);\n } else if (!that._oldHoverItem) {\n that._moveHover([], that.wrapper.children().first());\n }\n }\n },\n _keydown: function (e) {\n var that = this, key = e.keyCode, hoverItem = that._oldHoverItem, target, belongsToVertical, hasChildren, isRtl = kendo.support.isRtl(that.wrapper);\n if (e.target != e.currentTarget && key != keys.ESC) {\n return;\n }\n if (!hoverItem) {\n hoverItem = that._oldHoverItem = that._hoverItem();\n }\n belongsToVertical = that._itemBelongsToVertival(hoverItem);\n hasChildren = that._itemHasChildren(hoverItem);\n if (key == keys.RIGHT) {\n target = that[isRtl ? '_itemLeft' : '_itemRight'](hoverItem, belongsToVertical, hasChildren);\n } else if (key == keys.LEFT) {\n target = that[isRtl ? '_itemRight' : '_itemLeft'](hoverItem, belongsToVertical, hasChildren);\n } else if (key == keys.DOWN) {\n target = that._itemDown(hoverItem, belongsToVertical, hasChildren);\n } else if (key == keys.UP) {\n target = that._itemUp(hoverItem, belongsToVertical, hasChildren);\n } else if (key == keys.ESC) {\n target = that._itemEsc(hoverItem, belongsToVertical);\n } else if (key == keys.ENTER || key == keys.SPACEBAR) {\n target = hoverItem.children('.k-link');\n if (target.length > 0) {\n that._click({\n target: target[0],\n preventDefault: function () {\n },\n enterKey: true\n });\n that._moveHover(hoverItem, that._findRootParent(hoverItem));\n }\n } else if (key == keys.TAB) {\n target = that._findRootParent(hoverItem);\n that._moveHover(hoverItem, target);\n that._checkActiveElement();\n return;\n }\n if (target && target[0]) {\n e.preventDefault();\n e.stopPropagation();\n }\n },\n _hoverItem: function () {\n return this.wrapper.find('.k-item.k-state-hover,.k-item.k-state-focused').filter(':visible');\n },\n _itemBelongsToVertival: function (item) {\n var menuIsVertical = this.wrapper.hasClass('k-menu-vertical');\n if (!item.length) {\n return menuIsVertical;\n }\n return item.parent().hasClass('k-menu-group') || menuIsVertical;\n },\n _itemHasChildren: function (item) {\n if (!item || !item.length || !item[0].nodeType) {\n return false;\n }\n return item.children('ul.k-menu-group, div.k-animation-container').length > 0 || !!item.data(POPUP_OPENER_ATTR) && !!this._overflowWrapper().children(popupGroupSelector(item.data(POPUP_OPENER_ATTR)));\n },\n _moveHover: function (item, nextItem) {\n var that = this, id = that._ariaId;\n if (item.length && nextItem.length) {\n item.removeClass(FOCUSEDSTATE);\n }\n if (nextItem.length) {\n if (nextItem[0].id) {\n id = nextItem[0].id;\n }\n nextItem.addClass(FOCUSEDSTATE);\n that._oldHoverItem = nextItem;\n if (id) {\n that.element.removeAttr('aria-activedescendant');\n $('#' + id).removeAttr('id');\n nextItem.attr('id', id);\n that.element.attr('aria-activedescendant', id);\n }\n that._scrollToItem(nextItem);\n }\n },\n _findRootParent: function (item) {\n if (this._isRootItem(item)) {\n return item;\n } else {\n return this._parentsUntil(item, menuSelector, 'li.k-item').last();\n }\n },\n _isRootItem: function (item) {\n return item.parent().hasClass(MENU);\n },\n _itemRight: function (item, belongsToVertical, hasChildren) {\n var that = this, nextItem, parentItem, overflowWrapper;\n if (item.hasClass(DISABLEDSTATE)) {\n return;\n }\n if (!belongsToVertical) {\n nextItem = item.nextAll(nextSelector);\n if (!nextItem.length) {\n nextItem = item.prevAll(lastSelector);\n }\n } else if (hasChildren) {\n that.open(item);\n nextItem = that._childPopupElement(item).children().first();\n } else if (that.options.orientation == 'horizontal') {\n parentItem = that._findRootParent(item);\n overflowWrapper = that._overflowWrapper();\n if (overflowWrapper) {\n var rootPopup = itemPopup(parentItem, overflowWrapper);\n that._closeChildPopups(rootPopup);\n }\n that.close(parentItem);\n nextItem = parentItem.nextAll(nextSelector);\n }\n if (nextItem && !nextItem.length) {\n nextItem = that.wrapper.children('.k-item').first();\n } else if (!nextItem) {\n nextItem = [];\n }\n that._moveHover(item, nextItem);\n return nextItem;\n },\n _itemLeft: function (item, belongsToVertical) {\n var that = this, nextItem, overflowWrapper;\n if (!belongsToVertical) {\n nextItem = item.prevAll(nextSelector);\n if (!nextItem.length) {\n nextItem = item.nextAll(lastSelector);\n }\n } else {\n nextItem = item.parent().closest('.k-item');\n overflowWrapper = that._overflowWrapper();\n if (!nextItem.length && overflowWrapper) {\n nextItem = popupParentItem(item.parent(), overflowWrapper);\n }\n that.close(nextItem);\n if (that._isRootItem(nextItem) && that.options.orientation == 'horizontal') {\n nextItem = nextItem.prevAll(nextSelector);\n }\n }\n if (!nextItem.length) {\n nextItem = that.wrapper.children('.k-item').last();\n }\n that._moveHover(item, nextItem);\n return nextItem;\n },\n _itemDown: function (item, belongsToVertical, hasChildren) {\n var that = this, nextItem;\n if (!belongsToVertical) {\n if (!hasChildren || item.hasClass(DISABLEDSTATE)) {\n return;\n } else {\n that.open(item);\n nextItem = that._childPopupElement(item).children().first();\n }\n } else {\n nextItem = item.nextAll(nextSelector);\n }\n if (!nextItem.length && item.length) {\n nextItem = item.parent().children().first();\n } else if (!item.length) {\n nextItem = that.wrapper.children('.k-item').first();\n }\n that._moveHover(item, nextItem);\n return nextItem;\n },\n _itemUp: function (item, belongsToVertical) {\n var that = this, nextItem;\n if (!belongsToVertical) {\n return;\n } else {\n nextItem = item.prevAll(nextSelector);\n }\n if (!nextItem.length && item.length) {\n nextItem = item.parent().children().last();\n } else if (!item.length) {\n nextItem = that.wrapper.children('.k-item').last();\n }\n that._moveHover(item, nextItem);\n return nextItem;\n },\n _scrollToItem: function (item) {\n var that = this;\n if (that.options.scrollable && item && item.length) {\n var ul = item.parent();\n var isHorizontal = ul.hasClass(MENU) ? that.options.orientation == 'horizontal' : false;\n var scrollDir = isHorizontal ? 'scrollLeft' : 'scrollTop';\n var getSize = isHorizontal ? kendo._outerWidth : kendo._outerHeight;\n var currentScrollOffset = ul[scrollDir]();\n var itemSize = getSize(item);\n var itemOffset = item[0][isHorizontal ? 'offsetLeft' : 'offsetTop'];\n var ulSize = getSize(ul);\n var scrollButtons = ul.siblings(scrollButtonSelector);\n var scrollButtonSize = scrollButtons.length ? getSize(scrollButtons.first()) : 0;\n var itemPosition;\n if (currentScrollOffset + ulSize < itemOffset + itemSize + scrollButtonSize) {\n itemPosition = itemOffset + itemSize - ulSize + scrollButtonSize;\n } else if (currentScrollOffset > itemOffset - scrollButtonSize) {\n itemPosition = itemOffset - scrollButtonSize;\n }\n if (!isNaN(itemPosition)) {\n var scrolling = {};\n scrolling[scrollDir] = itemPosition;\n ul.finish().animate(scrolling, 'fast', 'linear', function () {\n that._toggleScrollButtons(ul, scrollButtons.first(), scrollButtons.last(), isHorizontal);\n });\n }\n }\n },\n _itemEsc: function (item, belongsToVertical) {\n var that = this, nextItem;\n if (!belongsToVertical) {\n return item;\n } else {\n nextItem = item.parent().closest('.k-item');\n that.close(nextItem);\n that._moveHover(item, nextItem);\n }\n return nextItem;\n },\n _childPopupElement: function (item) {\n var popupElement = item.find('.k-menu-group');\n var wrapper = this._overflowWrapper();\n if (!popupElement.length && wrapper) {\n popupElement = itemPopup(item, wrapper);\n }\n return popupElement;\n },\n _triggerEvent: function (e) {\n var that = this;\n return that.trigger(e.type, {\n type: e.type,\n item: e.item\n });\n },\n _focusHandler: function (e) {\n var that = this, item = $(kendo.eventTarget(e)).closest(allItemsSelector);\n if (item.hasClass(DISABLEDSTATE)) {\n return;\n }\n setTimeout(function () {\n that._moveHover([], item);\n if (item.children('.k-content')[0]) {\n item.parent().closest('.k-item').removeClass(FOCUSEDSTATE);\n }\n }, 200);\n },\n _animations: function (options) {\n if (options && 'animation' in options && !options.animation) {\n options.animation = {\n open: { effects: {} },\n close: {\n hide: true,\n effects: {}\n }\n };\n }\n }\n });\n extend(Menu, {\n renderItem: function (options) {\n options = extend({\n menu: {},\n group: {}\n }, options);\n var empty = templates.empty, item = options.item;\n return templates.item(extend(options, {\n image: item.imageUrl ? templates.image : empty,\n sprite: item.spriteCssClass ? templates.sprite : empty,\n itemWrapper: templates.itemWrapper,\n renderContent: Menu.renderContent,\n arrow: item.items || item.content ? templates.arrow : empty,\n subGroup: Menu.renderGroup\n }, rendering));\n },\n renderGroup: function (options) {\n return templates.group(extend({\n renderItems: function (options) {\n var html = '', i = 0, items = options.items, len = items ? items.length : 0, group = extend({ length: len }, options.group);\n for (; i < len; i++) {\n html += Menu.renderItem(extend(options, {\n group: group,\n item: extend({ index: i }, items[i])\n }));\n }\n return html;\n }\n }, options, rendering));\n },\n renderContent: function (options) {\n return templates.content(extend(options, rendering));\n }\n });\n var ContextMenu = Menu.extend({\n init: function (element, options) {\n var that = this;\n Menu.fn.init.call(that, element, options);\n that._marker = kendo.guid().substring(0, 8);\n that.target = $(that.options.target);\n that._popup();\n that._wire();\n },\n _initOverflow: function (options) {\n var that = this;\n if (options.scrollable && !that._overflowWrapper()) {\n that._openedPopups = {};\n that._popupsWrapper = (that.element.parent().is(animationContainerSelector) ? that.element.parent() : that.element).wrap('
    ').parent();\n if (that.options.orientation == 'horizontal') {\n removeSpacesBetweenItems(that.element);\n }\n if (options.appendTo) {\n options.appendTo.append(that._popupsWrapper);\n }\n that._initialHeight = that.element[0].style.height;\n that._initialWidth = that.element[0].style.width;\n }\n },\n options: {\n name: 'ContextMenu',\n filter: null,\n showOn: 'contextmenu',\n orientation: 'vertical',\n alignToAnchor: false,\n target: 'body'\n },\n events: [\n OPEN,\n CLOSE,\n ACTIVATE,\n DEACTIVATE,\n SELECT\n ],\n setOptions: function (options) {\n var that = this;\n Menu.fn.setOptions.call(that, options);\n that.target.off(that.showOn + NS + that._marker, that._showProxy);\n if (that.userEvents) {\n that.userEvents.destroy();\n }\n that.target = $(that.options.target);\n if (options.orientation && that.popup.wrapper[0]) {\n that.popup.element.unwrap();\n }\n that._wire();\n Menu.fn.setOptions.call(this, options);\n },\n destroy: function () {\n var that = this;\n that.target.off(that.options.showOn + NS + that._marker);\n DOCUMENT_ELEMENT.off(kendo.support.mousedown + NS + that._marker, that._closeProxy);\n if (that.userEvents) {\n that.userEvents.destroy();\n }\n Menu.fn.destroy.call(that);\n },\n open: function (x, y) {\n var that = this;\n x = $(x)[0];\n if (contains(that.element[0], $(x)[0]) || that._itemHasChildren($(x))) {\n Menu.fn.open.call(that, x);\n } else {\n if (that._triggerEvent({\n item: that.element,\n type: OPEN\n }) === false) {\n if (that.popup.visible() && that.options.filter) {\n that.popup.close(true);\n that.popup.element.kendoStop(true);\n }\n if (y !== undefined) {\n var overflowWrapper = that._overflowWrapper();\n if (overflowWrapper) {\n var offset = overflowWrapper.offset();\n x -= offset.left;\n y -= offset.top;\n }\n that.popup.wrapper.hide();\n that._configurePopupScrolling(x, y);\n that.popup.open(x, y);\n } else {\n that.popup.options.anchor = (x ? x : that.popup.anchor) || that.target;\n that.popup.element.kendoStop(true);\n that._configurePopupScrolling();\n that.popup.open();\n }\n DOCUMENT_ELEMENT.off(that.popup.downEvent, that.popup._mousedownProxy);\n DOCUMENT_ELEMENT.on(kendo.support.mousedown + NS + that._marker, that._closeProxy);\n }\n }\n return that;\n },\n _configurePopupScrolling: function (x, y) {\n var that = this;\n var popup = that.popup;\n var isHorizontal = that.options.orientation == 'horizontal';\n if (that.options.scrollable) {\n that._wrapPopupElement(popup);\n popup.element.parent().css({\n position: '',\n height: ''\n });\n popup.element.css({\n visibility: 'hidden',\n display: '',\n position: ''\n });\n if (isHorizontal) {\n that._setPopupWidth(popup, isNaN(x) ? undefined : {\n isFixed: true,\n x: x,\n y: y\n });\n } else {\n that._setPopupHeight(popup, isNaN(x) ? undefined : {\n isFixed: true,\n x: x,\n y: y\n });\n }\n popup.element.css({\n visibility: '',\n display: 'none',\n position: 'absolute'\n });\n that._initPopupScrollButtons(popup, isHorizontal, true);\n popup.element.siblings(scrollButtonSelector).hide();\n }\n },\n _setPopupWidth: function (popup, isFixed) {\n var popupElement = popup.element;\n var popups = popupElement.add(popupElement.parent(animationContainerSelector));\n popups.width(this._initialWidth || '');\n var location = popup._location(isFixed);\n var windowWidth = $(window).width();\n var popupOuterWidth = location.width;\n var popupOffsetLeft = Math.max(location.left, 0);\n var scrollLeft = isFixed ? 0 : parentsScroll(this._overflowWrapper()[0], 'scrollLeft');\n var shadow = kendo.getShadows(popupElement);\n var maxWidth = windowWidth - shadow.left - shadow.right;\n var canFit = maxWidth + scrollLeft > popupOuterWidth + popupOffsetLeft;\n if (!canFit) {\n popups.css({\n overflow: 'hidden',\n width: maxWidth - popupOffsetLeft + scrollLeft + 'px'\n });\n }\n },\n close: function () {\n var that = this;\n if (contains(that.element[0], $(arguments[0])[0]) || that._itemHasChildren(arguments[0])) {\n Menu.fn.close.call(that, arguments[0]);\n } else {\n if (that.popup.visible()) {\n if (that._triggerEvent({\n item: that.element,\n type: CLOSE\n }) === false) {\n that.popup.close();\n DOCUMENT_ELEMENT.off(kendo.support.mousedown + NS, that._closeProxy);\n that.unbind(SELECT, that._closeTimeoutProxy);\n }\n }\n }\n },\n _showHandler: function (e) {\n var ev = e, offset, that = this, options = that.options;\n if (e.event) {\n ev = e.event;\n ev.pageX = e.x.location;\n ev.pageY = e.y.location;\n }\n if (contains(that.element[0], e.relatedTarget || e.target)) {\n return;\n }\n that._eventOrigin = ev;\n ev.preventDefault();\n ev.stopImmediatePropagation();\n that.element.find('.' + FOCUSEDSTATE).removeClass(FOCUSEDSTATE);\n if (options.filter && kendo.support.matchesSelector.call(ev.currentTarget, options.filter) || !options.filter) {\n if (options.alignToAnchor) {\n that.popup.options.anchor = ev.currentTarget;\n that.open(ev.currentTarget);\n } else {\n that.popup.options.anchor = ev.currentTarget;\n if (that._targetChild) {\n offset = that.target.offset();\n that.open(ev.pageX - offset.left, ev.pageY - offset.top);\n } else {\n that.open(ev.pageX, ev.pageY);\n }\n }\n }\n },\n _closeHandler: function (e) {\n var that = this, target = $(e.relatedTarget || e.target), sameTarget = target.closest(that.target.selector)[0] == that.target[0], item = target.closest(itemSelector), children = that._itemHasChildren(item), overflowWrapper = that._overflowWrapper(), containment = contains(that.element[0], target[0]) || overflowWrapper && contains(overflowWrapper[0], target[0]);\n that._eventOrigin = e;\n var normalClick = e.which !== 3;\n if (that.popup.visible() && (normalClick && sameTarget || !sameTarget) && (that.options.closeOnClick && !children && containment || !containment)) {\n if (containment) {\n this.unbind(SELECT, this._closeTimeoutProxy);\n that.bind(SELECT, that._closeTimeoutProxy);\n } else {\n that.close();\n }\n }\n },\n _wire: function () {\n var that = this, options = that.options, target = that.target;\n that._showProxy = proxy(that._showHandler, that);\n that._closeProxy = proxy(that._closeHandler, that);\n that._closeTimeoutProxy = proxy(that.close, that);\n if (target[0]) {\n if (kendo.support.mobileOS && options.showOn == 'contextmenu') {\n that.userEvents = new kendo.UserEvents(target, {\n filter: options.filter,\n allowSelection: false\n });\n target.on(options.showOn + NS + that._marker, false);\n that.userEvents.bind('hold', that._showProxy);\n } else {\n if (options.filter) {\n target.on(options.showOn + NS + that._marker, options.filter, that._showProxy);\n } else {\n target.on(options.showOn + NS + that._marker, that._showProxy);\n }\n }\n }\n },\n _triggerEvent: function (e) {\n var that = this, anchor = $(that.popup.options.anchor)[0], origin = that._eventOrigin;\n that._eventOrigin = undefined;\n return that.trigger(e.type, extend({\n type: e.type,\n item: e.item || this.element[0],\n target: anchor\n }, origin ? { event: origin } : {}));\n },\n _popup: function () {\n var that = this;\n var overflowWrapper = that._overflowWrapper();\n that._triggerProxy = proxy(that._triggerEvent, that);\n that.popup = that.element.addClass('k-context-menu').kendoPopup({\n anchor: that.target || 'body',\n copyAnchorStyles: that.options.copyAnchorStyles,\n collision: that.options.popupCollision || 'fit',\n animation: that.options.animation,\n activate: that._triggerProxy,\n deactivate: that._triggerProxy,\n appendTo: overflowWrapper || that.options.appendTo,\n close: !overflowWrapper ? $.noop : function (e) {\n $(getChildPopups(e.sender.element, overflowWrapper)).each(function (i, p) {\n var popup = p.data(KENDOPOPUP);\n if (popup) {\n popup.close(true);\n }\n });\n }\n }).data(KENDOPOPUP);\n that._targetChild = contains(that.target[0], that.popup.element[0]);\n }\n });\n ui.plugin(Menu);\n ui.plugin(ContextMenu);\n }(window.kendo.jQuery));\n return window.kendo;\n}, typeof define == 'function' && define.amd ? define : function (a1, a2, a3) {\n (a3 || a2)();\n}));"]}