mirror of
https://github.com/seejohnrun/haste-server.git
synced 2024-11-22 20:51:21 +00:00
Refactor to reduce nesting
This commit is contained in:
parent
f9558a34fa
commit
cfff6616e6
2 changed files with 30 additions and 29 deletions
|
@ -361,9 +361,11 @@ haste.prototype.configureShortcuts = function() {
|
||||||
|
|
||||||
///// Tab behavior in the textarea - 2 spaces per tab
|
///// Tab behavior in the textarea - 2 spaces per tab
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
$('textarea').keydown(function(evt) {
|
$('textarea').keydown(function(evt) {
|
||||||
if (evt.keyCode === 9 && ! evt.ctrlKey) {
|
if (evt.ctrlKey || evt.keyCode !== 9) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
var myValue = ' ';
|
var myValue = ' ';
|
||||||
// http://stackoverflow.com/questions/946534/insert-text-into-textarea-with-jquery
|
// http://stackoverflow.com/questions/946534/insert-text-into-textarea-with-jquery
|
||||||
|
@ -390,7 +392,6 @@ $(function() {
|
||||||
this.value += myValue;
|
this.value += myValue;
|
||||||
this.focus();
|
this.focus();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
2
static/application.min.js
vendored
2
static/application.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue