Skip to content

Commit

Permalink
Fixed #173, Fixed #168, Fixed #169,
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Feb 7, 2020
1 parent fb962d7 commit 0007663
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/components/contextmenu/ContextMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ export default {
padding: .25em;
display: block;
position: relative;
cursor: pointer;
}
.p-contextmenu .p-menuitem-icon {
Expand Down
10 changes: 6 additions & 4 deletions src/components/contextmenu/ContextMenuSub.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
<template v-for="(item, i) of model">
<li role="none" :class="getItemClass(item)" :style="item.style" v-if="item.visible !== false && !item.separator" :key="item.label + i"
@mouseenter="onItemMouseEnter($event, item)">
<router-link v-if="item.to" :to="item.to" class="p-menuitem-link"
@click.native="onItemClick($event, item)" role="menuitem">
<router-link v-if="item.to" :to="item.to" :class="getLinkClass(item)" @click.native="onItemClick($event, item)" role="menuitem">
<span :class="['p-menuitem-icon', item.icon]"></span>
<span class="p-menuitem-text">{{item.label}}</span>
</router-link>
<a v-else :href="item.url||'#'" class="p-menuitem-link" :target="item.target"
@click="onItemClick($event, item)" :aria-haspopup="item.items != null" :aria-expanded="item === activeItem" role="menuitem">
<a v-else :href="item.url" :class="getLinkClass(item)" :target="item.target" @click="onItemClick($event, item)"
:aria-haspopup="item.items != null" :aria-expanded="item === activeItem" role="menuitem" :tabindex="item.disabled ? null : '0'">
<span :class="['p-menuitem-icon', item.icon]"></span>
<span class="p-menuitem-text">{{item.label}}</span>
<span class="p-submenu-icon pi pi-fw pi-caret-right" v-if="item.items"></span>
Expand Down Expand Up @@ -115,6 +114,9 @@ export default {
'p-disabled': item.disabled,
}
]
},
getLinkClass(item) {
return ['p-menuitem-link', {'p-disabled': item.disabled}];
}
},
computed: {
Expand Down
1 change: 1 addition & 0 deletions src/components/menubar/Menubar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export default {
padding: .25em;
position: relative;
text-decoration: none;
cursor: pointer;
}
.p-menubar .p-menuitem-icon {
Expand Down
9 changes: 6 additions & 3 deletions src/components/menubar/MenubarSub.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<template v-for="(item, i) of model">
<li role="none" :class="getItemClass(item)" :style="item.style" v-if="item.visible !== false && !item.separator" :key="item.label + i"
@mouseenter="onItemMouseEnter($event, item)">
<router-link v-if="item.to" :to="item.to" class="p-menuitem-link"
<router-link v-if="item.to" :to="item.to" :class="getLinkClass(item)"
@click.native="onItemClick($event, item)" @keydown.native="onItemKeyDown($event, item)" role="menuitem">
<span :class="['p-menuitem-icon', item.icon]"></span>
<span class="p-menuitem-text">{{item.label}}</span>
</router-link>
<a v-else :href="item.url||'#'" class="p-menuitem-link" :target="item.target" :aria-haspopup="item.items != null" :aria-expanded="item === activeItem"
@click="onItemClick($event, item)" @keydown="onItemKeyDown($event, item)" role="menuitem">
<a v-else :href="item.url" :class="getLinkClass(item)" :target="item.target" :aria-haspopup="item.items != null" :aria-expanded="item === activeItem"
@click="onItemClick($event, item)" @keydown="onItemKeyDown($event, item)" role="menuitem" :tabindex="item.disabled ? null : '0'">
<span :class="['p-menuitem-icon', item.icon]"></span>
<span class="p-menuitem-text">{{item.label}}</span>
<span :class="getSubmenuIcon()" v-if="item.items"></span>
Expand Down Expand Up @@ -240,6 +240,9 @@ export default {
}
]
},
getLinkClass(item) {
return ['p-menuitem-link', {'p-disabled': item.disabled}];
},
bindDocumentClickListener() {
if (!this.documentClickListener) {
this.documentClickListener = (event) => {
Expand Down
1 change: 1 addition & 0 deletions src/components/tieredmenu/TieredMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ export default {
display: block;
position: relative;
text-decoration: none;
cursor: pointer;
}
.p-tieredmenu .p-menuitem-icon {
Expand Down
9 changes: 6 additions & 3 deletions src/components/tieredmenu/TieredMenuSub.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<template v-for="(item, i) of model">
<li :class="getItemClass(item)" :style="item.style" v-if="item.visible !== false && !item.separator" :key="item.label + i"
@mouseenter="onItemMouseEnter($event, item)" role="none">
<router-link v-if="item.to" :to="item.to" class="p-menuitem-link"
<router-link v-if="item.to" :to="item.to" :class="getLinkClass(item)"
@click.native="onItemClick($event, item)" @keydown.native="onItemKeyDown($event, item)" role="menuitem">
<span :class="['p-menuitem-icon', item.icon]"></span>
<span class="p-menuitem-text">{{item.label}}</span>
</router-link>
<a v-else :href="item.url||'#'" class="p-menuitem-link" :target="item.target" :aria-haspopup="item.items != null" :aria-expanded="item === activeItem"
@click="onItemClick($event, item)" @keydown="onItemKeyDown($event, item)" role="menuitem">
<a v-else :href="item.url" :class="getLinkClass(item)" :target="item.target" :aria-haspopup="item.items != null" :aria-expanded="item === activeItem"
@click="onItemClick($event, item)" @keydown="onItemKeyDown($event, item)" role="menuitem" :tabindex="item.disabled ? null : '0'">
<span :class="['p-menuitem-icon', item.icon]"></span>
<span class="p-menuitem-text">{{item.label}}</span>
<span class="p-submenu-icon pi pi-fw pi-caret-right" v-if="item.items"></span>
Expand Down Expand Up @@ -191,6 +191,9 @@ export default {
}
]
},
getLinkClass(item) {
return ['p-menuitem-link', {'p-disabled': item.disabled}];
},
bindDocumentClickListener() {
if (!this.documentClickListener) {
this.documentClickListener = (event) => {
Expand Down

0 comments on commit 0007663

Please sign in to comment.