summaryrefslogtreecommitdiffstats
path: root/data/js/application.js
diff options
context:
space:
mode:
authorJoakim Reinert <mail@jreinert.com>2015-04-19 01:21:28 +0200
committerFlorian Pritz <bluewind@xinu.at>2015-05-05 12:21:27 +0200
commitf0be7e7412721039cdd37798fe294dd5cb41d216 (patch)
tree7b0c731174da32296d2e061f867af0393f401a66 /data/js/application.js
parentc6448f49018ba88d5b2525b224415e6d7fd2b4fe (diff)
Refactor linewrap toggle
Diffstat (limited to 'data/js/application.js')
-rw-r--r--data/js/application.js9
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;