Skip to content

Commit

Permalink
Disable Tribute on delete. (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsweaters authored Jul 1, 2016
1 parent a7445c6 commit 4742160
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dist/tribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@ if (!Array.prototype.find) {
_this6.setActiveLi();
}
}
},
delete: function _delete(e, el) {
if (_this6.tribute.isActive && _this6.tribute.current.mentionText.length < 1) {
_this6.tribute.hideMenu();
}
}
};
}
Expand All @@ -549,7 +554,7 @@ if (!Array.prototype.find) {
}], [{
key: 'keys',
value: function keys() {
return [{ key: 9, value: 'TAB' }, { key: 13, value: 'ENTER' }, { key: 27, value: 'ESCAPE' }, { key: 38, value: 'UP' }, { key: 40, value: 'DOWN' }];
return [{ key: 9, value: 'TAB' }, { key: 8, value: 'DELETE' }, { key: 13, value: 'ENTER' }, { key: 27, value: 'ESCAPE' }, { key: 38, value: 'UP' }, { key: 40, value: 'DOWN' }];
}
}]);

Expand Down
6 changes: 6 additions & 0 deletions js/tribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ if (!Array.prototype.find) {
static keys() {
return [
{key: 9, value: 'TAB'},
{key: 8, value: 'DELETE'},
{key: 13, value: 'ENTER'},
{key: 27, value: 'ESCAPE'},
{key: 38, value: 'UP'},
Expand Down Expand Up @@ -460,6 +461,11 @@ if (!Array.prototype.find) {
this.setActiveLi()
}
}
},
delete: (e, el) => {
if (this.tribute.isActive && this.tribute.current.mentionText.length < 1) {
this.tribute.hideMenu();
}
}
}
}
Expand Down

0 comments on commit 4742160

Please sign in to comment.