summaryrefslogtreecommitdiffstats
path: root/data
diff options
context:
space:
mode:
Diffstat (limited to 'data')
-rw-r--r--data/js/application.js21
-rw-r--r--data/js/script.js9
2 files changed, 21 insertions, 9 deletions
diff --git a/data/js/application.js b/data/js/application.js
index 2ae412051..ef520be65 100644
--- a/data/js/application.js
+++ b/data/js/application.js
@@ -21,15 +21,36 @@ define(
* config contains app config attributes passed from php
*/
onPageLoaded: function (config) {
+ config = config || {};
Util.highlightLineFromHash();
Util.setTabwidthFromLocalStorage();
TabwidthInput.initialize();
LexerInput.initialize(config.lexers);
+ this.configureTooltips();
+ this.setupToggleSelectAllEvent();
},
setupLineHighlight: function () {
$(window).on('hashchange', Util.highlightLineFromHash);
},
+
+ configureTooltips: function () {
+ $('[rel="tooltip"]').tooltip({
+ placement: 'bottom',
+ container: 'body',
+ });
+ },
+
+ setupToggleSelectAllEvent: function () {
+ $('#history-all').on('click', function(event) {
+ // Suppress click event on table heading
+ event.stopImmediatePropagation();
+ });
+ $('#history-all').on('change', function(event) {
+ var checked = $(event.target).prop('checked');
+ $('.delete-history').prop('checked', checked);
+ });
+ }
};
diff --git a/data/js/script.js b/data/js/script.js
index 242cf74de..f0ab3cc94 100644
--- a/data/js/script.js
+++ b/data/js/script.js
@@ -1,14 +1,5 @@
(function($) {
$(function() {
- $('[rel="tooltip"]').tooltip({
- placement: 'bottom',
- container: 'body',
- });
-
- $('#history-all').bind('change', function() {
- $('.delete-history').prop('checked', $(this).is(':checked'));
- });
-
window.lines_wrapped = true;
$('[id^=linewrap-]').click(function() {
if (window.lines_wrapped == true) {