Lint fixes

pull/132/head
cagataycivici 2019-12-05 11:31:01 +03:00
parent bb47325012
commit 5302d3d3b8
1 changed files with 15 additions and 15 deletions

View File

@ -1,12 +1,12 @@
<template> <template>
<div :class="containerClass"> <div :class="containerClass">
<ul class="p-megamenu-root-list"> <ul class="p-megamenu-root-list">
<li v-for="(category,index) of model" :key="category.label + '_' + index" :class="getCategoryClass(category)" :style="category.style" <li v-for="(category,index) of model" :key="category.label + '_' + index" :class="getCategoryClass(category)" :style="category.style"
@mouseenter="onCategoryMouseEnter($event, category)"> @mouseenter="onCategoryMouseEnter($event, category)">
<a :href="category.url||'#'" class="p-menuitem-link" :target="category.target" @click="onCategoryClick($event, category)" @keydown="onCategoryKeydown($event, category)"> <a :href="category.url||'#'" class="p-menuitem-link" :target="category.target" @click="onCategoryClick($event, category)" @keydown="onCategoryKeydown($event, category)">
<span v-if="category.icon" :class="getCategoryIcon(category)"></span> <span v-if="category.icon" :class="getCategoryIcon(category)"></span>
<span class="p-menuitem-text">{{category.label}}</span> <span class="p-menuitem-text">{{category.label}}</span>
<span v-if="category.items" :class="getCategorySubMenuIcon(category)"></span> <span v-if="category.items" :class="getCategorySubMenuIcon()"></span>
</a> </a>
<div class="p-megamenu-panel" v-if="category.items"> <div class="p-megamenu-panel" v-if="category.items">
<div class="p-grid"> <div class="p-grid">
@ -87,7 +87,7 @@ export default {
event.preventDefault(); event.preventDefault();
return; return;
} }
if (this.activeItem) { if (this.activeItem) {
this.activeItem = category; this.activeItem = category;
} }
@ -117,7 +117,7 @@ export default {
else { else {
this.activeItem = category; this.activeItem = category;
this.bindDocumentClickListener(); this.bindDocumentClickListener();
} }
} }
}, },
onCategoryKeydown(event, category) { onCategoryKeydown(event, category) {
@ -140,7 +140,7 @@ export default {
this.navigateToPrevItem(listItem); this.navigateToPrevItem(listItem);
else if (category.items && category === this.activeItem) else if (category.items && category === this.activeItem)
this.collapseMenu(); this.collapseMenu();
event.preventDefault(); event.preventDefault();
break; break;
@ -150,7 +150,7 @@ export default {
this.navigateToNextItem(listItem); this.navigateToNextItem(listItem);
else else
this.expandMenu(category); this.expandMenu(category);
event.preventDefault() event.preventDefault()
break; break;
@ -163,7 +163,7 @@ export default {
event.preventDefault(); event.preventDefault();
break; break;
default: default:
break; break;
} }
@ -173,7 +173,7 @@ export default {
this.activeItem = item; this.activeItem = item;
} }
}, },
collapseMenu(item) { collapseMenu() {
this.activeItem = null; this.activeItem = null;
}, },
findNextItem(item) { findNextItem(item) {
@ -186,7 +186,7 @@ export default {
}, },
findPrevItem(item) { findPrevItem(item) {
let prevItem = item.previousElementSibling; let prevItem = item.previousElementSibling;
if (prevItem) if (prevItem)
return DomHandler.hasClass(prevItem, 'p-disabled') || !DomHandler.hasClass(prevItem, 'p-menuitem') ? this.findPrevItem(prevItem) : prevItem; return DomHandler.hasClass(prevItem, 'p-disabled') || !DomHandler.hasClass(prevItem, 'p-menuitem') ? this.findPrevItem(prevItem) : prevItem;
else else
@ -210,7 +210,7 @@ export default {
'p-disabled': category.disabled 'p-disabled': category.disabled
}, category.class]; }, category.class];
}, },
getCategorySubMenuIcon(category) { getCategorySubMenuIcon() {
return ['p-submenu-icon pi pi-fw', { return ['p-submenu-icon pi pi-fw', {
'pi-caret-down': this.horizontal, 'pi-caret-down': this.horizontal,
'pi-caret-right': this.vertical 'pi-caret-right': this.vertical
@ -227,24 +227,24 @@ export default {
case 2: case 2:
columnClass= 'p-col-6'; columnClass= 'p-col-6';
break; break;
case 3: case 3:
columnClass= 'p-col-4'; columnClass= 'p-col-4';
break; break;
case 4: case 4:
columnClass= 'p-col-3'; columnClass= 'p-col-3';
break; break;
case 6: case 6:
columnClass= 'p-col-2'; columnClass= 'p-col-2';
break; break;
default: default:
columnClass= 'p-col-12'; columnClass= 'p-col-12';
break; break;
} }
return columnClass; return columnClass;
}, },
getSubmenuHeaderClass(submenu) { getSubmenuHeaderClass(submenu) {