Merge pull request #2593 from gpasztor87/patch-1

Fix backendPreferences live update script.
This commit is contained in:
Samuel Georges 2017-01-09 06:28:30 +11:00 committed by GitHub
commit 5caf40c4ad
1 changed files with 14 additions and 15 deletions

View File

@ -1,4 +1,4 @@
$(document).ready(function(){
$(document).ready(function() {
var editorEl = $('#editorpreferencesCodeeditor'),
editor = editorEl.codeEditor('getEditorObject'),
@ -7,23 +7,23 @@ $(document).ready(function(){
editorEl.height($('#editorSettingsForm').height() - 23)
$('#Form-field-Preferences-editor_theme').on('change', function(){
$('#Form-field-Preference-editor_theme').on('change', function() {
editorEl.codeEditor('setTheme', $(this).val())
})
$('#Form-field-Preferences-editor_font_size').on('change', function(){
$('#Form-field-Preference-editor_font_size').on('change', function() {
editor.setFontSize(parseInt($(this).val()))
})
$('#Form-field-Preferences-editor_word_wrap').on('change', function(){
$('#Form-field-Preference-editor_word_wrap').on('change', function() {
editorEl.codeEditor('setWordWrap', $(this).val())
})
$('#Form-field-Preferences-editor_code_folding').on('change', function(){
$('#Form-field-Preference-editor_code_folding').on('change', function() {
session.setFoldStyle($(this).val())
})
$('#Form-field-Preferences-editor_autocompletion').on('change', function(){
$('#Form-field-Preference-editor_autocompletion').on('change', function() {
editor.setOption('enableBasicAutocompletion', false)
editor.setOption('enableLiveAutocompletion', false)
@ -36,37 +36,36 @@ $(document).ready(function(){
}
})
$('#Form-field-Preferences-editor_tab_size').on('change', function(){
$('#Form-field-Preference-editor_tab_size').on('change', function() {
session.setTabSize($(this).val())
})
$('#Form-field-Preferences-editor_show_invisibles').on('change', function(){
$('#Form-field-Preference-editor_show_invisibles').on('change', function() {
editor.setShowInvisibles($(this).is(':checked'))
})
$('#Form-field-Preferences-editor_enable_snippets').on('change', function(){
$('#Form-field-Preference-editor_enable_snippets').on('change', function() {
editor.setOption('enableSnippets', $(this).is(':checked'))
})
$('#Form-field-Preferences-editor_display_indent_guides').on('change', function(){
$('#Form-field-Preference-editor_display_indent_guides').on('change', function() {
editor.setDisplayIndentGuides($(this).is(':checked'))
})
$('#Form-field-Preferences-editor_show_print_margin').on('change', function(){
$('#Form-field-Preference-editor_show_print_margin').on('change', function() {
editor.setShowPrintMargin($(this).is(':checked'))
})
$('#Form-field-Preferences-editor_highlight_active_line').on('change', function(){
$('#Form-field-Preference-editor_highlight_active_line').on('change', function() {
editor.setHighlightActiveLine($(this).is(':checked'))
})
$('#Form-field-Preferences-editor_use_hard_tabs').on('change', function(){
$('#Form-field-Preference-editor_use_hard_tabs').on('change', function() {
session.setUseSoftTabs(!$(this).is(':checked'))
})
$('#Form-field-Preferences-editor_show_gutter').on('change', function(){
$('#Form-field-Preference-editor_show_gutter').on('change', function() {
renderer.setShowGutter($(this).is(':checked'))
})
})