From c5bd7cf541e5fdd9329f4b8c4edd3637ff9b2507 Mon Sep 17 00:00:00 2001 From: Marco Dickert Date: Fri, 17 Feb 2017 15:49:40 +0100 Subject: [PATCH] add switch for word wrapping in ace editor --- ifm.php | 7 ++++++- src/ifm.js | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ifm.php b/ifm.php index 9a50df2..37a7edb 100644 --- a/ifm.php +++ b/ifm.php @@ -596,7 +596,8 @@ function IFM() { var content = arguments.length > 1 ? arguments[1] : ""; var overlay = '
'; overlay += ''; + overlay += '
'; self.showModal( overlay, { large: true } ); @@ -607,6 +608,10 @@ function IFM() { self.editor.getSession().setValue(content); self.editor.focus(); self.editor.on("change", function() { self.fileChanged = true; }); + // word wrap checkbox + $('#aceWordWrap').on( 'change', function (event) { + self.editor.getSession().setUseWrapMode( $(this).is(':checked') ); + }); }; this.createDirForm = function() { diff --git a/src/ifm.js b/src/ifm.js index bb4fede..43ee564 100644 --- a/src/ifm.js +++ b/src/ifm.js @@ -167,7 +167,8 @@ function IFM() { var content = arguments.length > 1 ? arguments[1] : ""; var overlay = '
'; overlay += ''; + overlay += '
'; self.showModal( overlay, { large: true } ); @@ -178,6 +179,10 @@ function IFM() { self.editor.getSession().setValue(content); self.editor.focus(); self.editor.on("change", function() { self.fileChanged = true; }); + // word wrap checkbox + $('#aceWordWrap').on( 'change', function (event) { + self.editor.getSession().setUseWrapMode( $(this).is(':checked') ); + }); }; this.createDirForm = function() {