diff options
author | Joakim Reinert <mail@jreinert.com> | 2015-04-19 01:21:28 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2015-05-05 12:21:27 +0200 |
commit | f0be7e7412721039cdd37798fe294dd5cb41d216 (patch) | |
tree | 7b0c731174da32296d2e061f867af0393f401a66 /data/js/application.js | |
parent | c6448f49018ba88d5b2525b224415e6d7fd2b4fe (diff) |
Refactor linewrap toggle
Diffstat (limited to 'data/js/application.js')
-rw-r--r-- | data/js/application.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/data/js/application.js b/data/js/application.js index ef520be65..a82c193c8 100644 --- a/data/js/application.js +++ b/data/js/application.js @@ -28,6 +28,7 @@ define( LexerInput.initialize(config.lexers); this.configureTooltips(); this.setupToggleSelectAllEvent(); + this.setupLineWrapToggle(); }, setupLineHighlight: function () { @@ -50,8 +51,14 @@ define( var checked = $(event.target).prop('checked'); $('.delete-history').prop('checked', checked); }); - } + }, + setupLineWrapToggle: function () { + var linesWrapped = localStorage.getItem('lines_wrapped') || 'true'; + Util.setLineWrap(linesWrapped === 'true'); + + $('.linewrap-toggle').on('click', _.bind(Util.toggleLineWrap, Util)); + } }; return App; |