{"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","LINK_SELECTOR","contents","this","nodeName","match","excludedNodesRegExp","nodeType","trim","nodeValue","wrapAll","updateArrow","updateFirstLast","find","remove","each","arrowCssClass","getArrowCssClass","support","hasClass","MENU","removeClass","FIRST","LAST","updateHasAriaPopup","parents","index","parentLi","eq","getParentLiItems","group","parentsUntil","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","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","window","ui","activeElement","_activeElement","mobileOS","isArray","HierarchicalDataSource","MOUSEDOWN","CLICK","DELAY","SCROLLSPEED","extend","proxy","template","keys","Widget","NS","OPEN","ICON_SELECTOR","CLOSE","TIMER","SELECT","ZINDEX","ACTIVATE","DEACTIVATE","POINTERDOWN","pointers","msPointers","CHANGE","ERROR","TOUCHSTART","MOUSEENTER","MOUSELEAVE","MOUSEWHEEL","RESIZE","resize","SCROLLWIDTH","SCROLLHEIGHT","OFFSETWIDTH","OFFSETHEIGHT","DOCUMENT_ELEMENT","document","documentElement","KENDOPOPUP","HOVERSTATE","FOCUSEDSTATE","SELECTEDSTATE","menuSelector","groupSelector","popupSelector","allItemsSelector","disabledSelector","itemSelector","availableItemsSelector","linkSelector","exclusionSelector","nextSelector","lastSelector","templateSelector","scrollButtonSelector","2","STRING","DATABOUND","bindings","text","url","spriteCssClass","imageUrl","imageAttr","content","rendering","wrapperCssClass","enabled","firstLevel","cssClass","hasOwnProperty","selected","itemCssAttributes","attributes","imageCssAttributes","imgAttributes","toJSON","contentCssAttributes","contentAttr","defaultClasses","textClass","arrowClass","groupAttributes","expanded","groupCssClass","Menu","DataBoundWidget","init","that","fn","call","wrapper","_accessors","_templates","_dataSource","_updateClasses","_animations","nextItemZIndex","_tabindex","_initOverflow","_attachMenuEventsHandlers","openOnClick","clicked","_ariaId","format","notify","events","name","animation","open","duration","close","orientation","closeOnClick","hoverDelay","scrollable","popupCollision","_initData","dataSource","angular","elements","view","_overflowWrapper","on","_focusHandler","_click","_preventClose","_mouseenter","_mouseleave","_mousedown","_toggleHover","_keydown","_focus","_removeHoverItem","_checkActiveElement","_mouseleavePopup","_mouseenterPopup","_documentClickHandler","_documentClick","click","_detachMenuEventsHandlers","off","unbind","backwardBtn","forwardBtn","initialWidth","initialCssWidth","isHorizontal","_openedPopups","_scrollWrapper","wrap","templates","scrollButton","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","attemptGetItem","candidate","referenceItem","inserted","_insert","insertBefore","before","insertAfter","after","groups","plain","groupData","isPlainObject","ObservableObject","renderGroup","ObservableArray","map","idx","get","renderItem","charAt","parentItems","container","_openAfterLoad","dataItem","loaded","one","_loading","visiblePopups","closePopup","getByUid","hasChildren","load","closest","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","mouseAndTouchPresent","_configurePopupOverflow","_hovered","_initPopupScrolling","popupOpener","groupId","_wrapPopupElement","Date","getTime","autosize","display","skipMouseEvents","scrollHeight","offsetHeight","_initPopupScrollButtons","scrollButtons","timeout","p","isEmptyObject","_closeParentPopups","first","_keyTriggered","_setPopupHeight","isFixed","location","popupOuterHeight","popupOffsetTop","bottomScrollbar","canFit","popups","_initialHeight","_location","max","top","innerHeight","dontClearClose","hasChildPopupsHovered","isPopupMouseLeaved","_isRootItem","_forceClose","toggleClass","target","eventTarget","isEnter","indexOf","_closurePrevented","hoverItem","_hoverItem","_findRootParent","hasFocus","oldHoverItem","_oldHoverItem","nonContentGroupsSelector","matchesSelector","end","_itemHasChildren","pointerTouch","delegateTarget","rootMenuItems","subMenuItems","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","HOME","END","_itemEsc","ENTER","SPACEBAR","_childPopupElement","TAB","menuIsVertical","nextItem","_scrollToItem","_itemRight","parentItem","nextAll","prevAll","_itemLeft","scrollDir","getSize","currentScrollOffset","itemSize","itemOffset","ulSize","scrollButtonSize","itemPosition","_outerWidth","_unbindDataSource","fields","field","create","_bindDataSource","fetch","_refreshHandler","refresh","_errorHandler","_error","bind","findByUid","uid","wrapperElement","node","action","parentElement","itemsToUpdate","updateProxy","_updateItem","removeProxy","_removeItem","_appendItems","forEach","nextElement","next","textField","_fieldAccessor","fieldName","fieldBindings","count","x","expr","fieldAccessor","itemWrapper","arrow","sprite","menu","renderContent","dataContentField","subGroup","renderItems","html","len","ContextMenu","_marker","guid","substring","_popup","_wire","_initialWidth","showOn","alignToAnchor","_showProxy","userEvents","mousedown","_closeProxy","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","UserEvents","allowSelection","_triggerProxy","copyAnchorStyles","noop","plugin","jQuery","amd","a1","a2","a3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;CAwBC,SAAUA,EAAGC,QACVA,OAAO,cACH,cACA,cACDD,IACL,WA89DE,MAl9DC,UAAUE,EAAGC,GAmGV,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,GAAK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WAAA,GACAhY,GAAOrL,KACP6C,EAAkBwI,EAAKkC,kBAC3BlC,GAAKua,cAAgBxf,EAAMiF,EAAK+K,cAAe/K,GAC/CA,EAAKnI,MAAQmI,EAAKvJ,QAAQ7C,SAAS,kBAAkB8X,YACjDmB,SAAuC,eAA7B7M,EAAKtJ,QAAQ8K,YACvByK,OAAQjM,EAAK6O,QAAU,OACvB2L,iBAAkBxa,EAAKtJ,QAAQ8jB,iBAC/BxO,UAAWhM,EAAKtJ,QAAQkL,gBAAkB,MAC1CR,UAAWpB,EAAKtJ,QAAQ0K,UACxBuK,SAAU3L,EAAKua,cACf3O,WAAY5L,EAAKua,cACjBrW,SAAU1M,GAAmBwI,EAAKtJ,QAAQwN,SAC1C3C,MAAQ/J,EAA2B,SAAU/D,GACzCrB,EAAEkF,EAAe7D,EAAEoY,OAAOpV,QAASe,IAAkBjC,KAAK,SAAUwB,EAAGsW,GACnE,GAAIxV,GAAQwV,EAAErW,KAAK8F,GACfjF,IACAA,EAAM0J,OAAM,MAJEnP,EAAEqoB,OAQ7BzjB,KAAK8F,IACRkD,EAAK+Z,aAAezmB,EAAS0M,EAAK6O,OAAO,GAAI7O,EAAKnI,MAAMpB,QAAQ,MAGxE2D,GAAGsgB,OAAO7a,IACVzF,EAAGsgB,OAAO9C,KACZzd,OAAOjH,MAAMynB,QACRxgB,OAAOjH,OACE,kBAAVf,SAAwBA,OAAOyoB,IAAMzoB,OAAS,SAAU0oB,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', [\n 'kendo.popup',\n 'kendo.data'\n ], 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: [\n 'popup',\n 'data',\n 'data.odata'\n ]\n };\n (function ($, undefined) {\n var kendo = window.kendo, ui = kendo.ui, activeElement = kendo._activeElement, touch = kendo.support.touch && kendo.support.mobileOS, isArray = $.isArray, HierarchicalDataSource = kendo.data.HierarchicalDataSource, 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 k-menu-link', LINK_SELECTOR = '.k-link', ICON_SELECTOR = '.k-icon', 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, CHANGE = 'change', ERROR = 'error', TOUCHSTART = kendo.support.touch ? 'touchstart' : '', MOUSEENTER = pointers ? 'pointerover' : msPointers ? 'MSPointerOver' : 'mouseenter', MOUSELEAVE = pointers ? 'pointerout' : msPointers ? 'MSPointerOut' : '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', availableItemsSelector = '.k-item:not(.k-state-disabled)', linkSelector = '.k-item:not(.k-state-disabled) > .k-link', exclusionSelector = ':not(.k-item.k-separator)', nextSelector = itemSelector + exclusionSelector + ':eq(0)', lastSelector = itemSelector + exclusionSelector + ':last', templateSelector = 'div:not(.k-animation-container,.k-list-container)', scrollButtonSelector = '.k-menu-scroll-button', touchPointerTypes = {\n '2': 1,\n 'touch': 1\n }, STRING = 'string', DATABOUND = 'dataBound', bindings = {\n text: 'dataTextField',\n url: 'dataUrlField',\n spriteCssClass: 'dataSpriteCssClassField',\n imageUrl: 'dataImageUrlField',\n imageAttr: 'dataImageAttrField',\n content: 'dataContentField'\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 (imgAttributes) {\n var result = '';\n var attributes = imgAttributes && imgAttributes.toJSON ? imgAttributes.toJSON() : {};\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 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 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_SELECTOR).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-60]: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 updateHasAriaPopup(parents) {\n if (parents && parents.length) {\n for (var index in parents) {\n var parentLi = parents.eq(index);\n if (parentLi.find('ul').length) {\n parentLi.attr('aria-haspopup', true);\n } else {\n parentLi.removeAttr('aria-haspopup');\n }\n }\n }\n }\n function getParentLiItems(group) {\n if (!group.hasClass(MENU)) {\n return group.parentsUntil('.' + MENU, 'li');\n }\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 && 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 = kendo.ui.DataBoundWidget.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._accessors();\n that._templates();\n that._dataSource();\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 DATABOUND\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 () {\n var that = this;\n if (that.dataSource) {\n that.angular('cleanup', function () {\n return { elements: that.element.children() };\n });\n that.element.empty();\n that.append(that.dataSource.view(), 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, availableItemsSelector, proxy(that._mouseenter, that)).on(MOUSELEAVE + NS, availableItemsSelector, proxy(that._mouseleave, that)).on(MOUSEDOWN + NS, availableItemsSelector, proxy(that._mousedown, that)).on(TOUCHSTART + NS + ' ' + 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 = $(that.templates.scrollButton({ direction: isHorizontal ? 'left' : 'up' }));\n forwardBtn = $(that.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 && wrapperWidth > 0) {\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._dataSource(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 attemptGetItem: function (candidate) {\n candidate = candidate || this.element;\n var item = this.element.find(candidate);\n var overflowWrapper = this._overflowWrapper();\n if (item.length || candidate === this.element) {\n return item;\n } else {\n return overflowWrapper && overflowWrapper.find(candidate);\n }\n },\n append: function (item, referenceItem) {\n referenceItem = this.attemptGetItem(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 updateHasAriaPopup(getParentLiItems(inserted.group));\n return this;\n },\n insertBefore: function (item, referenceItem) {\n referenceItem = this.attemptGetItem(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.attemptGetItem(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) || item instanceof kendo.data.ObservableObject, 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 = $(that.renderGroup({\n group: groupData,\n options: that.options\n })).appendTo(referenceItem);\n }\n if (plain || isArray(item) || item instanceof kendo.data.ObservableArray) {\n items = $($.map(plain ? [item] : item, function (value, idx) {\n if (typeof value === 'string') {\n return $(value).get();\n } else {\n return $(that.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.attemptGetItem(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 parentItems = getParentLiItems(group);\n var container = group.parent(animationContainerSelector);\n if (container.length) {\n container.remove();\n } else {\n group.remove();\n }\n updateHasAriaPopup(parentItems);\n }\n if (parent.length) {\n parent = parent.eq(0);\n updateArrow(parent);\n updateFirstLast(parent);\n }\n return that;\n },\n _openAfterLoad: function (element, dataItem) {\n var that = this;\n if (dataItem.loaded()) {\n that.open(element);\n } else {\n dataItem.one(CHANGE, function () {\n element.find(ICON_SELECTOR).removeClass('k-i-loading');\n if (that._loading) {\n that.open(element);\n that._loading = false;\n }\n });\n }\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 var dataItem = that.dataSource && that.dataSource.getByUid(element.data('uid'));\n if (dataItem && dataItem.hasChildren && !dataItem.loaded() && !that._loading) {\n that._loading = true;\n element.find(ICON_SELECTOR).addClass('k-i-loading');\n dataItem.load();\n that._openAfterLoad(element, dataItem);\n return;\n }\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 that.close($(this).closest('li.k-item'), true);\n }\n };\n element.siblings().find(visiblePopups).each(closePopup);\n if (overflowWrapper) {\n element.find(visiblePopups).each(closePopup);\n }\n if (that.options.openOnClick) {\n that.clicked = true;\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 || kendo.support.mouseAndTouchPresent) {\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._hovered = true;\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 = $(that.templates.scrollButton({ direction: isHorizontal ? 'left' : 'up' }));\n var forwardBtn = $(that.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 if (!this._keyTriggered) {\n e.sender.element.children('.' + FOCUSEDSTATE).removeClass(FOCUSEDSTATE);\n }\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 target.siblings().removeClass(HOVERSTATE);\n if (!target.parents('li.' + DISABLEDSTATE).length) {\n target.toggleClass(HOVERSTATE, isEnter || e.type == 'mousedown' || e.type == 'pointerover' || e.type == TOUCHSTART);\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')).parent('li').attr('aria-haspopup', 'true').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 that._keyTriggered = false;\n if (that.options.openOnClick.rootMenuItems && that._isRootItem(element.closest(allItemsSelector)) || that.options.openOnClick.subMenuItems && !that._isRootItem(element.closest(allItemsSelector))) {\n return;\n }\n if ((that.options.openOnClick === false || that.options.openOnClick.rootMenuItems === false && that._isRootItem(element.closest(allItemsSelector)) || that.options.openOnClick.subMenuItems === false && !that._isRootItem(element.closest(allItemsSelector)) || 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 === true && that.clicked || touch) {\n element.siblings().each(proxy(function (_, sibling) {\n that.close(sibling, true);\n }, that));\n }\n },\n _mousedown: function (e) {\n var that = this;\n var element = $(e.currentTarget);\n if (that.options.openOnClick.subMenuItems && !that._isRootItem(element) || 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 === false || !that.options.openOnClick.rootMenuItems && that._isRootItem(element) || !that.options.openOnClick.subMenuItems && !that._isRootItem(element)) && !touch && !isPointerTouch(e) && !contains(e.currentTarget, e.relatedTarget || e.target) && hasChildren && !contains(e.currentTarget, kendo._activeElement())) {\n that.close(element, true);\n that._loading = false;\n return;\n }\n if (kendo.support.browser.msie && !e.toElement && !e.relatedTarget && !isPointerTouch(e) || 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_SELECTOR), 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 === false) && !options.openOnClick.subMenuItems && !kendo.support.touch && !(isPointerTouch(e) && 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 target = target.is('.k-link') ? target : target.closest('.k-link');\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 that._keyTriggered = true;\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.HOME) {\n that._moveHover(hoverItem, hoverItem.parent().children().first());\n e.preventDefault();\n } else if (key == keys.END) {\n that._moveHover(hoverItem, hoverItem.parent().children().last());\n e.preventDefault();\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 if (hasChildren && !hoverItem.hasClass(DISABLEDSTATE)) {\n that.open(hoverItem);\n that._moveHover(hoverItem, that._childPopupElement(hoverItem).children().first());\n } else {\n that._moveHover(hoverItem, that._findRootParent(hoverItem));\n }\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('.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 (!belongsToVertical) {\n nextItem = item.nextAll(nextSelector);\n if (!nextItem.length) {\n nextItem = item.prevAll(lastSelector);\n }\n that.close(item);\n } else if (hasChildren && !item.hasClass(DISABLEDSTATE)) {\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 that.close(item);\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 _dataSource: function (options) {\n var that = this, dataSource = options ? options.dataSource : that.options.dataSource;\n if (!dataSource) {\n return;\n }\n dataSource = isArray(dataSource) ? { data: dataSource } : dataSource;\n that._unbindDataSource();\n if (!dataSource.fields) {\n dataSource.fields = [\n { field: 'uid' },\n { field: 'text' },\n { field: 'url' },\n { field: 'cssClass' },\n { field: 'spriteCssClass' },\n { field: 'imageUrl' },\n { field: 'imageAttr' },\n { field: 'attr' },\n { field: 'contentAttr' },\n { field: 'content' },\n { field: 'encoded' },\n { field: 'items' },\n { field: 'select' }\n ];\n }\n that.dataSource = HierarchicalDataSource.create(dataSource);\n that._bindDataSource();\n that.dataSource.fetch();\n },\n _bindDataSource: function () {\n this._refreshHandler = proxy(this.refresh, this);\n this._errorHandler = proxy(this._error, this);\n this.dataSource.bind(CHANGE, this._refreshHandler);\n this.dataSource.bind(ERROR, this._errorHandler);\n },\n _unbindDataSource: function () {\n var dataSource = this.dataSource;\n if (dataSource) {\n dataSource.unbind(CHANGE, this._refreshHandler);\n dataSource.unbind(ERROR, this._errorHandler);\n }\n },\n _error: function () {\n },\n findByUid: function (uid) {\n var wrapperElement = this._overflowWrapper() || this.element;\n return wrapperElement.find('[data-uid=' + uid + ']');\n },\n refresh: function (ev) {\n var that = this;\n var node = ev.node;\n var action = ev.action;\n var parentElement = node ? that.findByUid(node.uid) : that.element;\n var itemsToUpdate = ev.items;\n var index = ev.index;\n var updateProxy = $.proxy(that._updateItem, that);\n var removeProxy = $.proxy(that._removeItem, that);\n if (action == 'add') {\n that._appendItems(itemsToUpdate, index, parentElement);\n } else if (action == 'remove') {\n itemsToUpdate.forEach(removeProxy);\n } else if (action == 'itemchange') {\n itemsToUpdate.forEach(updateProxy);\n } else if (action === 'itemloaded') {\n that.append(ev.items, parentElement);\n } else {\n this._initData();\n }\n this.trigger(DATABOUND, {\n item: parentElement,\n dataItem: node\n });\n },\n _appendItems: function (items, index, parent) {\n var that = this;\n var referenceItem = parent.find(itemSelector).eq(index);\n if (referenceItem.length) {\n that.insertBefore(items, referenceItem);\n } else {\n that.append(items, parent);\n }\n },\n _removeItem: function (item) {\n var that = this;\n var element = that.findByUid(item.uid);\n that.remove(element);\n },\n _updateItem: function (item) {\n var that = this;\n var element = that.findByUid(item.uid);\n var nextElement = element.next();\n var parentNode = item.parentNode();\n that.remove(element);\n if (nextElement.length) {\n that.insertBefore(item, nextElement);\n } else {\n that.append(item, parentNode && that.findByUid(parentNode.uid));\n }\n },\n _accessors: function () {\n var that = this, options = that.options, i, field, textField, element = that.element;\n for (i in bindings) {\n field = options[bindings[i]];\n textField = element.attr(kendo.attr(i + '-field'));\n if (!field && textField) {\n field = textField;\n }\n if (!field) {\n field = i;\n }\n if (!isArray(field)) {\n field = [field];\n }\n options[bindings[i]] = field;\n }\n },\n _fieldAccessor: function (fieldName) {\n var fieldBindings = this.options[bindings[fieldName]] || [], count = fieldBindings.length, result = '(function(item) {';\n if (count === 0) {\n result += 'return item[\\'' + fieldName + '\\'];';\n } else {\n result += 'var levels = [' + $.map(fieldBindings, function (x) {\n return 'function(d){ return ' + kendo.expr(x) + '}';\n }).join(',') + '];';\n result += 'if(item.level){return levels[Math.min(item.level(), ' + count + '-1)](item);}else';\n result += '{return levels[' + count + '-1](item)}';\n }\n result += '})';\n return result;\n },\n _templates: function () {\n var that = this, options = that.options, fieldAccessor = proxy(that._fieldAccessor, that);\n if (options.template && typeof options.template == STRING) {\n options.template = template(options.template);\n } else if (!options.template) {\n options.template = template('# var text = ' + fieldAccessor('text') + '(data.item); #' + '# if (typeof data.item.encoded != \\'undefined\\' && data.item.encoded === false) {#' + '#= text #' + '# } else { #' + '#: text #' + '# } #');\n }\n that.templates = {\n content: template('#var contentHtml = ' + fieldAccessor('content') + '(item);#' + '
#= contentHtml || \\'\\' #
'),\n group: template('
    ' + '#= renderItems(data) #' + '
'),\n itemWrapper: template('# var url = ' + fieldAccessor('url') + '(item); #' + '# var imageUrl = ' + fieldAccessor('imageUrl') + '(item); #' + '# var imgAttributes = ' + fieldAccessor('imageAttr') + '(item);#' + '# var tag = url ? \\'a\\' : \\'span\\' #' + '<#= tag # class=\\'#= textClass(item) #\\' #if(url){#href=\\'#= url #\\'#}#>' + '# if (imageUrl) { #' + '\\'\\'' + '# } #' + '#= sprite(item) ##= data.menu.options.template(data) #' + '#= arrow(data) #' + ''),\n item: template('#var contentHtml = ' + fieldAccessor('content') + '(item);#' + '
  • ' + '#= itemWrapper(data) #' + '#if (item.hasChildren || item.items) { #' + '#= subGroup({ items: item.items, menu: menu, group: { expanded: item.expanded } }) #' + '# } else if (item.content || item.contentUrl || contentHtml) { #' + '#= renderContent(data) #' + '# } #' + '
  • '),\n scrollButton: template('' + ''),\n arrow: template(''),\n sprite: template('# var spriteCssClass = ' + fieldAccessor('spriteCssClass') + '(data); if(spriteCssClass) {##}#'),\n empty: template('')\n };\n },\n renderItem: function (options) {\n var that = this;\n options = extend({\n menu: that,\n group: {}\n }, options);\n var empty = that.templates.empty, item = options.item;\n return that.templates.item(extend(options, {\n sprite: that.templates.sprite,\n itemWrapper: that.templates.itemWrapper,\n renderContent: that.renderContent,\n arrow: item.items || item.content || item[that.options.dataContentField[0]] ? that.templates.arrow : empty,\n subGroup: that.renderGroup\n }, rendering));\n },\n renderGroup: function (options) {\n var that = this;\n var templates = that.templates || options.menu.templates;\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 += options.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 options.menu.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._marker, 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, target = kendo.support.mobileOS ? $(ev.target) : $(ev.currentTarget);\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 && target.is(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 autosize: that.options.orientation === 'horizontal',\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}));"]}