|
@@ -83,7 +83,7 @@
|
|
menu.find('.sc:eq(' + index + ')').addClass('active');
|
|
menu.find('.sc:eq(' + index + ')').addClass('active');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- function apply() {
|
|
|
|
|
|
+ function apply(_clearReturn = false) {
|
|
if(input && options && options.length && index >= 0 && index < options.length) {
|
|
if(input && options && options.length && index >= 0 && index < options.length) {
|
|
// $(input).focus();
|
|
// $(input).focus();
|
|
if(backtrackAfterApplying) {
|
|
if(backtrackAfterApplying) {
|
|
@@ -91,6 +91,7 @@
|
|
document.execCommand("delete", true, null);
|
|
document.execCommand("delete", true, null);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if(_clearReturn) document.execCommand("delete", true, null);
|
|
document.execCommand("insertText", true, options[index].value);
|
|
document.execCommand("insertText", true, options[index].value);
|
|
discard();
|
|
discard();
|
|
}
|
|
}
|
|
@@ -181,7 +182,7 @@
|
|
break;
|
|
break;
|
|
case 13:
|
|
case 13:
|
|
if(!isVisible()) return;
|
|
if(!isVisible()) return;
|
|
- apply();
|
|
|
|
|
|
+ apply(true);
|
|
consumed = true;
|
|
consumed = true;
|
|
break;
|
|
break;
|
|
case 8:
|
|
case 8:
|