mirror of
https://github.com/toptal/haste-server.git
synced 2025-02-22 02:42:28 +01:00
Refactor to reduce nesting
This commit is contained in:
parent
f9558a34fa
commit
cfff6616e6
@ -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 New Issue
Block a user