Permalink
Browse files

feat(table): Add row-dblclicked event (#780)

* [table] Add row-dbl-clicked event

* [table] Add row-dblclicked event meta.json
  • Loading branch information...
tmorehouse committed Aug 9, 2017
1 parent 763a35a commit 1aaf9150480a17a35884f639a037911b2624f111
Showing with 24 additions and 0 deletions.
  1. +14 −0 docs/components/table/meta.json
  2. +10 −0 lib/components/table.vue
@@ -16,6 +16,20 @@
}
]
},
{
"event": "row-dblclicked",
"description": "Emitted when a row is double clicked.",
"args": [
{
"arg": "item",
"description": "Item data of the row being double clicked."
},
{
"arg": "index",
"description": "Index of the row being double clicked."
}
]
},
{
"event": "row-hovered",
"description": "Emitted when a row is hovered.",
@@ -50,6 +50,7 @@
:key="index"
:class="rowClass(item)"
@click="rowClicked($event,item,index)"
@dblclick="rowDblClicked($event,item,index)"
@hover="rowHovered($event,item,index)"
>
<template v-for="(field,key) in fields">
@@ -466,6 +467,15 @@
}
this.$emit('row-clicked', item, index);
},
rowDblClicked(e, item, index) {
if (this.busy) {
// If table is busy (via provider) then don't propagate
e.preventDefault();
e.stopPropagation();
return;
}
this.$emit('row-dblclicked', item, index);
},
rowHovered(e, item, index) {
if (this.busy) {
// If table is busy (via provider) then don't propagate

0 comments on commit 1aaf915

Please sign in to comment.