This commit is contained in:
Mo Bitar
2017-01-19 10:42:18 -06:00
parent 9dec414dc4
commit df8468b07d

View File

@@ -16,15 +16,15 @@ angular.module('app.frontend')
link:function(scope, elem, attrs, ctrl) { link:function(scope, elem, attrs, ctrl) {
var handler = function(event) { var handler = function(event) {
// Handle Tab Key // Handle Tab Key
if (event.which == 9) { if (event.which == 9) {
event.preventDefault(); event.preventDefault();
var start = event.target.selectionStart; var start = event.target.selectionStart;
var end = event.target.selectionEnd; var end = event.target.selectionEnd;
var spaces = " "; var spaces = " ";
event.target.value = event.target.value.substring(0, start) event.target.value = event.target.value.substring(0, start)
+ spaces + event.target.value.substring(end); + spaces + event.target.value.substring(end);
} }
if (event.ctrlKey || event.metaKey) { if (event.ctrlKey || event.metaKey) {
switch (String.fromCharCode(event.which).toLowerCase()) { switch (String.fromCharCode(event.which).toLowerCase()) {
case 's': case 's':