Skip to content

Commit

Permalink
Merge pull request #27 from LucaRainone/master
Browse files Browse the repository at this point in the history
Rename event listeners to work with templates defined in DOM.
  • Loading branch information
Nathan Reyes authored Dec 15, 2017
2 parents 6c81c2a + 2c4489d commit f65e719
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/components/Calendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ export default {
this.refreshToPage();
},
fromPage_(val) {
this.$emit('update:fromPage', val);
this.$emit('update:frompage', val);
if (!pageIsBeforePage(val, this.toPage_)) {
this.toPage_ = getNextPage(val);
}
},
toPage_(val) {
this.$emit('update:toPage', val);
this.$emit('update:topage', val);
if (!pageIsAfterPage(val, this.fromPage_)) {
this.fromPage_ = getPrevPage(val);
}
Expand Down
8 changes: 4 additions & 4 deletions src/components/CalendarDay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,21 +170,21 @@ export default {
Math.abs(state.x - state.startX) <= defaults.maxTapTolerance &&
Math.abs(state.y - state.startY) <= defaults.maxTapTolerance;
if (state.tapDetected) {
this.$emit('daySelect', this.dayInfo, this.attributesMap);
this.$emit('dayselect', this.dayInfo, this.attributesMap);
}
state.started = false;
},
click() {
if (this.touchState && this.touchState.tapDetected) return;
this.$emit('daySelect', this.dayInfo, this.attributesMap);
this.$emit('dayselect', this.dayInfo, this.attributesMap);
},
mouseenter() {
this.isHovered = true;
this.$emit('dayMouseEnter', this.dayInfo, this.attributesMap);
this.$emit('daymouseenter', this.dayInfo, this.attributesMap);
},
mouseleave() {
this.isHovered = false;
this.$emit('dayMouseLeave', this.dayInfo, this.attributesMap);
this.$emit('daymouseleave', this.dayInfo, this.attributesMap);
},
processAttributes() {
const backgrounds = [];
Expand Down
8 changes: 4 additions & 4 deletions src/components/DatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ export default {
this.toPage_ = val;
},
fromPage_(val) {
this.$emit('update:fromPage', val);
this.$emit('update:frompage', val);
},
toPage_(val) {
this.$emit('update:toPage', val);
this.$emit('update:topage', val);
},
mode() {
// Clear value on select mode change
Expand Down Expand Up @@ -184,8 +184,8 @@ export default {
filteredListeners() {
// Remove parent listeners that we want to intercept and re-broadcast
const listeners = { ...this.$listeners };
delete listeners['update:fromPage'];
delete listeners['update:toPage'];
delete listeners['update:frompage'];
delete listeners['update:topage'];
return listeners;
},
popoverDidDisappear() {
Expand Down

0 comments on commit f65e719

Please sign in to comment.