Support for tab key
This commit is contained in:
parent
469e664d74
commit
301c51f6ac
1
css/main-min.css
vendored
1
css/main-min.css
vendored
@ -5347,6 +5347,7 @@ li.L7,
|
||||
li.L9 { background: #eee }
|
||||
body {
|
||||
background-color: #f5f5f5;
|
||||
tab-size: 4;
|
||||
}
|
||||
.working {
|
||||
cursor: progress;
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
body {
|
||||
background-color: #f5f5f5;
|
||||
tab-size: 4;
|
||||
}
|
||||
|
||||
.working {
|
||||
|
14
js/core.js
14
js/core.js
@ -620,6 +620,20 @@ define(
|
||||
$("#wmd-input").css({
|
||||
"font-size": core.settings.editorFontSize + "px",
|
||||
"line-height": Math.round(core.settings.editorFontSize * (20/14)) + "px"
|
||||
}).keydown(function(e) {
|
||||
// Manage tab key
|
||||
if(e.keyCode === 9) {
|
||||
var value = $(this).val();
|
||||
var start = this.selectionStart;
|
||||
var end = this.selectionEnd;
|
||||
// IE8 does not support selection attributes
|
||||
if(start === undefined || end === undefined) {
|
||||
return;
|
||||
}
|
||||
$(this).val(value.substring(0, start) + "\t" + value.substring(end));
|
||||
this.selectionStart = this.selectionEnd = start + 1;
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
$(".action-load-settings").click(function() {
|
||||
|
2
js/main-min.js
vendored
2
js/main-min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user