Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Commit

Permalink
Merge pull request #998 from Pomax/colorbacker
Browse files Browse the repository at this point in the history
color picker always  hides on 'back' now
  • Loading branch information
thisandagain committed Feb 11, 2015
2 parents 4a9d0fa + 84abe4b commit 9787484
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions components/colorPicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ module.exports = {
this.$on('openCP', function (event) {
this.show = true;
this.originalColor = event;
this.cancelIntercept = this.onCancel.bind(this);
document.addEventListener('backbutton',
this.cancelIntercept, true);
});
},
computed: {
Expand Down Expand Up @@ -38,6 +41,9 @@ module.exports = {
},
onCancel: function (e) {
e.preventDefault();
e.stopPropagation();
document.removeEventListener('backbutton',
this.cancelIntercept, true);
this.selectedColor = this.originalColor;
this.show = false;
}
Expand Down

0 comments on commit 9787484

Please sign in to comment.