From 98b3a5f2cf196687d66ef03724609f17896901fd 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 37f1f72..fc6addd 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}} @@ -1942,6 +1942,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 f8dd6d0..d6c410e 100644 --- a/ifm.php +++ b/ifm.php @@ -484,9 +484,9 @@ f00bar; > {{i18n.soft_tabs}}
{{i18n.tab_size}}
{{#ace_includes}} - {{#modes}} - + {{/modes}} {{/ace_includes}} @@ -1942,6 +1942,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 07ee3a0..acec388 100644 --- a/src/ifm.js +++ b/src/ifm.js @@ -487,6 +487,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}}