From e3beaa709c2c2e2d9de3a0d8f398f2b8dbdbe883 Mon Sep 17 00:00:00 2001 From: Marco Dickert Date: Tue, 20 Mar 2018 19:46:28 +0100 Subject: [PATCH] Fixed missing EventListener for the editor-syntax select box. --- build/libifm.php | 8 ++++++-- ifm.php | 8 ++++++-- src/ifm.js | 4 ++++ src/templates/modal.file_editoroptions.html | 4 ++-- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/build/libifm.php b/build/libifm.php index c85fd09..8fe7ad4 100644 --- a/build/libifm.php +++ b/build/libifm.php @@ -484,9 +484,9 @@ f00bar; > {{i18n.soft_tabs}}
{{i18n.tab_size}}
{{#ace_includes}} - {{#modes}} - + {{/modes}} {{/ace_includes}} @@ -1940,6 +1940,10 @@ function IFM( params ) { self.editor.setOption( 'tabSize', e.srcElement.value ); } }); + else if( el.id == "editor-syntax" ) + el.addEventListener( 'change', function( e ) { + self.editor.getSession().setMode( e.target.value ); + }); }); return content; } diff --git a/ifm.php b/ifm.php index c4a4f10..d12151f 100644 --- a/ifm.php +++ b/ifm.php @@ -484,9 +484,9 @@ f00bar; > {{i18n.soft_tabs}}
{{i18n.tab_size}}
{{#ace_includes}} - {{#modes}} - + {{/modes}} {{/ace_includes}} @@ -1940,6 +1940,10 @@ function IFM( params ) { self.editor.setOption( 'tabSize', e.srcElement.value ); } }); + else if( el.id == "editor-syntax" ) + el.addEventListener( 'change', function( e ) { + self.editor.getSession().setMode( e.target.value ); + }); }); return content; } diff --git a/src/ifm.js b/src/ifm.js index f9a6c3b..295d3e7 100644 --- a/src/ifm.js +++ b/src/ifm.js @@ -485,6 +485,10 @@ function IFM( params ) { self.editor.setOption( 'tabSize', e.srcElement.value ); } }); + else if( el.id == "editor-syntax" ) + el.addEventListener( 'change', function( e ) { + self.editor.getSession().setMode( e.target.value ); + }); }); return content; } diff --git a/src/templates/modal.file_editoroptions.html b/src/templates/modal.file_editoroptions.html index 6e91c49..4b65fa0 100644 --- a/src/templates/modal.file_editoroptions.html +++ b/src/templates/modal.file_editoroptions.html @@ -10,9 +10,9 @@ > {{i18n.soft_tabs}}
{{i18n.tab_size}}
{{#ace_includes}} - {{#modes}} - + {{/modes}} {{/ace_includes}}