Skip to content

Commit

Permalink
fix(data-table): replace vue-events with native vue $emit and $on; re…
Browse files Browse the repository at this point in the history
…move element ids, scoped some specific styles and fix some ui issues
  • Loading branch information
alexanderrudnik committed Jul 31, 2017
1 parent 825cac2 commit 22d9816
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
"vue2-circle-progress": "^1.0.3",
"vuetable-2": "^1.6.5",
"vuex": "2.1.1",
"vuex-router-sync": "4.0.2",
"vue-events": "^3.0.1"
"vuex-router-sync": "4.0.2"
},
"devDependencies": {
"autoprefixer": "^6.7.2",
Expand Down
5 changes: 3 additions & 2 deletions src/components/common/vuestic-datatable/DataTable.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<template>
<div>
<div class="d-flex justify-content-between">
<filter-bar></filter-bar>
<filter-bar @filter="onFilterSet"></filter-bar>
<items-per-page :options="itemsPerPage"
:defaultPerPage="perPage"></items-per-page>
:defaultPerPage="perPage"
@items-per-page="onItemsPerPage"></items-per-page>
</div>
<div class="table-responsive">
<vuetable ref="vuetable"
Expand Down
4 changes: 2 additions & 2 deletions src/components/common/vuestic-datatable/FilterBar.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="form-group with-icon-left">
<div class="input-group">
<input id="input-icon-left" name="input-icon-left" @keyup="doFilter" v-model="filterText" required/>
<input id="input-icon-left" name="input-icon-left" @keyup="doFilter()" v-model="filterText" required/>
<i class="glyphicon glyphicon-search icon-left input-icon search-icon"></i>
<label class="control-label" for="input-icon-left">Search</label><i class="bar"></i>
</div>
Expand All @@ -18,7 +18,7 @@
},
methods: {
doFilter () {
this.$events.fire('filter-set', this.filterText)
this.$emit('filter', this.filterText)
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/components/common/vuestic-datatable/ItemsPerPage.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<template>
<div class="form-group dropdown" v-dropdown.closeOnMenuClick>
<button id="itemsPerPageBtn" class="btn btn-primary btn-sm dropdown-toggle green-box-shadow" type="button"
<button id="itemsPerPageBtn" class="btn btn-primary btn-sm dropdown-toggle" type="button"
data-toggle="dropdown">
{{selected}} per page
<i class="ion-chevron-down arrow-down"></i>
</button>
<div id="itemsPerPageMenu" class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" v-for="option in options" @click="selectedItemsPerPage(option.value)">{{option.value}} per page</a>
</div>
</div>
Expand Down Expand Up @@ -36,16 +36,16 @@
methods: {
selectedItemsPerPage (optionValue) {
this.selected = optionValue
this.$events.fire('items-per-page', this.selected)
this.$emit('items-per-page', this.selected)
}
}
}
</script>

<style lang="scss">
<style lang="scss" scoped>
@import "../../../sass/variables";
.btn#itemsPerPageBtn, #itemsPerPageMenu {
.btn.dropdown-toggle, .dropdown-menu {
min-width: 13rem;
max-width: 13rem;
}
Expand Down
5 changes: 5 additions & 0 deletions src/sass/_override-bootstrap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,11 @@ h4, .h4 {
font-size: 1rem;
}

th.sortable:hover {
color: $vue-green !important;
opacity: .6;
}

//Badges

.badge {
Expand Down

0 comments on commit 22d9816

Please sign in to comment.