-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…3620) * [Menu API] All our drop down menu's now use the new menu api #3607 Co-authored-by: charlesh88 <charles.f.hacskaylo@nasa.gov> Co-authored-by: Andrew Henry <akhenry@gmail.com>
- Loading branch information
1 parent
cf35667
commit f9bd31d
Showing
13 changed files
with
561 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<template> | ||
<div class="c-menu" | ||
:class="[options.menuClass, 'c-super-menu']" | ||
> | ||
<ul v-if="options.actions.length && options.actions[0].length" | ||
class="c-super-menu__menu" | ||
> | ||
<template | ||
v-for="(actionGroups, index) in options.actions" | ||
> | ||
<li | ||
v-for="action in actionGroups" | ||
:key="action.name" | ||
:class="[action.cssClass, action.isDisabled ? 'disabled' : '']" | ||
:title="action.description" | ||
@click="action.callBack" | ||
@mouseover="toggleItemDescription(action)" | ||
@mouseleave="toggleItemDescription()" | ||
> | ||
{{ action.name }} | ||
</li> | ||
<div | ||
v-if="index !== options.actions.length - 1" | ||
:key="index" | ||
class="c-menu__section-separator" | ||
> | ||
</div> | ||
<li | ||
v-if="actionGroups.length === 0" | ||
:key="index" | ||
> | ||
No actions defined. | ||
</li> | ||
</template> | ||
</ul> | ||
|
||
<ul v-else | ||
class="c-super-menu__menu" | ||
> | ||
<li | ||
v-for="action in options.actions" | ||
:key="action.name" | ||
:class="action.cssClass" | ||
:title="action.description" | ||
@click="action.callBack" | ||
@mouseover="toggleItemDescription(action)" | ||
@mouseleave="toggleItemDescription()" | ||
> | ||
{{ action.name }} | ||
</li> | ||
<li v-if="options.actions.length === 0"> | ||
No actions defined. | ||
</li> | ||
</ul> | ||
|
||
<div class="c-super-menu__item-description"> | ||
<div :class="['l-item-description__icon', 'bg-' + hoveredItem.cssClass]"></div> | ||
<div class="l-item-description__name"> | ||
{{ hoveredItem.name }} | ||
</div> | ||
<div class="l-item-description__description"> | ||
{{ hoveredItem.description }} | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
inject: ['options'], | ||
data: function () { | ||
return { | ||
hoveredItem: {} | ||
}; | ||
}, | ||
methods: { | ||
toggleItemDescription(action = {}) { | ||
const hoveredItem = { | ||
name: action.name, | ||
description: action.description, | ||
cssClass: action.cssClass | ||
}; | ||
this.hoveredItem = Object.assign({}, this.hoveredItem, hoveredItem); | ||
} | ||
} | ||
}; | ||
</script> |
Oops, something went wrong.