Skip to content

Commit

Permalink
fixing click handling since keyCode attribute is missing now on mouse…
Browse files Browse the repository at this point in the history
… events in chrome
  • Loading branch information
jason.smith committed Oct 23, 2015
1 parent a18a7e6 commit f7b0e1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/objects/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ TodoTxt.View = {
},

handleAltEnter: function (e) {
if ((e.keyCode === 13 && e.altKey) || e.keyCode === 0) { // Alt + Enter
if (e.keyCode && (e.keyCode === 13 && e.altKey) || (e.type && e.type == "click")) { // Alt + Enter
var taskId = document.querySelector("#modalEditTaskId-input").value;
var text = document.querySelector("#modalEdit-textarea").textContent;
text = TodoTxt.Utils.htmlUnencode(text);
Expand Down Expand Up @@ -359,7 +359,7 @@ TodoTxt.View = {
},

handleAltP: function (e) {
if ((e.keyCode === 80 && e.altKey) || e.keyCode === 0) { // Alt + Enter
if ((e.keyCode === 80 && e.altKey) || (e.type && e.type == "click")) { // Alt + p
// update the markup of the displayed task in the Modal
TodoTxt.View.updateModalPreview();
}
Expand Down

0 comments on commit f7b0e1d

Please sign in to comment.