Replace Chosen jQuery plugin by custom UI component

This commit is contained in:
Frederic Guillot
2016-12-11 15:46:54 -05:00
parent a2b44371e0
commit ffb3926178
21 changed files with 385 additions and 1795 deletions

View File

@@ -31,7 +31,6 @@ Kanboard.App.prototype.execute = function() {
}
this.focus();
this.chosen();
this.keyboardShortcuts();
this.datePicker();
this.autoComplete();
@@ -56,12 +55,6 @@ Kanboard.App.prototype.keyboardShortcuts = function() {
}
});
// Open board selector
Mousetrap.bind("b", function(e) {
e.preventDefault();
$('#board-selector').trigger('chosen:open');
});
// Close popover and dropdown
Mousetrap.bindGlobal("esc", function() {
if (! document.getElementById('suggest-menu')) {
@@ -88,27 +81,6 @@ Kanboard.App.prototype.focus = function() {
});
};
Kanboard.App.prototype.chosen = function() {
$(".chosen-select").each(function() {
var searchThreshold = $(this).data("search-threshold");
if (searchThreshold === undefined) {
searchThreshold = 10;
}
$(this).chosen({
width: "180px",
no_results_text: $(this).data("notfound"),
disable_search_threshold: searchThreshold
});
});
$(".select-auto-redirect").change(function() {
var regex = new RegExp($(this).data('redirect-regex'), 'g');
window.location = $(this).data('redirect-url').replace(regex, $(this).val());
});
};
Kanboard.App.prototype.datePicker = function() {
var bodyElement = $("body");
var dateFormat = bodyElement.data("js-date-format");