summaryrefslogtreecommitdiffstats
path: root/data/js/application.js
diff options
context:
space:
mode:
Diffstat (limited to 'data/js/application.js')
-rw-r--r--data/js/application.js21
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);
+ });
+ }
};