save editor theme to localStorage (#2583)

This commit is contained in:
onukura
2020-10-18 17:12:47 +09:00
committed by GitHub
parent eab82bf1be
commit 5193d82980

View File

@@ -126,10 +126,16 @@
$(function(){
$('#editor').text($('#initial').val());
var editor = ace.edit("editor");
if(typeof localStorage.getItem('gitbucket:editor:theme') == "string"){
$('#theme').val(localStorage.getItem('gitbucket:editor:theme'));
}
editor.setTheme("ace/theme/" + $('#theme').val());
$('#theme').change(function(){
editor.setTheme("ace/theme/" + $('#theme').val());
localStorage.setItem('gitbucket:editor:theme', $('#theme').val());
});
if(localStorage.getItem('gitbucket:editor:wrap') == 'true'){