diff options
author | Joakim Reinert <mail@jreinert.com> | 2015-04-19 00:53:34 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2015-05-05 12:21:27 +0200 |
commit | c6448f49018ba88d5b2525b224415e6d7fd2b4fe (patch) | |
tree | 0b22cece7e61f43cf2e353b2bd664b1fbea1add9 /data/js/application.js | |
parent | 7a6ddaf571efa3e87d6f40a4e465d31d16583979 (diff) |
Do minor refactoring on app js
Diffstat (limited to 'data/js/application.js')
-rw-r--r-- | data/js/application.js | 21 |
1 files changed, 21 insertions, 0 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); + }); + } }; |