summaryrefslogtreecommitdiffstats
path: root/data/js/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'data/js/util.js')
-rw-r--r--data/js/util.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/data/js/util.js b/data/js/util.js
index 810bc4167..6c88edb2d 100644
--- a/data/js/util.js
+++ b/data/js/util.js
@@ -27,6 +27,22 @@ define(['jquery'], function () {
}
PrivateFunctions.highlightLine(hash);
+ },
+ focusDropdownInput: function (target) {
+ setTimeout(function () {
+ var dropDown = $(target).siblings('.dropdown-menu');
+ dropDown.find('input').trigger('focus');
+ }, 0);
+ },
+ setTabwidth: function (value) {
+ value = value || 8;
+ $('span.tabwidth-value').html(value);
+ $('.tabwidth-form input').val(value);
+ $('.highlight pre').css('tab-size', value);
+ localStorage.setItem('tabwidth', value);
+ },
+ setTabwidthFromLocalStorage: function () {
+ this.setTabwidth(localStorage.getItem('tabwidth'));
}
};
return Util;