Refactoring/simplification of the pull-request about links

This commit is contained in:
Frederic Guillot
2015-02-14 16:11:13 -05:00
parent 364382b1b5
commit f7e4c3928a
77 changed files with 1407 additions and 2588 deletions

View File

@@ -1,19 +0,0 @@
Kanboard.Link = (function() {
function on_change() {
if ($('.behaviour').prop('checked')) {
$('.link-inverse-label').hide();
}
else {
$('.link-inverse-label').show();
}
}
jQuery(document).ready(function() {
if (Kanboard.Exists("link-edit-section")) {
on_change();
$(".behaviour").click(on_change);
}
});
})();

22
assets/js/src/task.js Normal file
View File

@@ -0,0 +1,22 @@
Kanboard.Task = (function() {
jQuery(document).ready(function() {
if ($(".task-autocomplete").length) {
$("input[type=submit]").attr('disabled','disabled');
$(".task-autocomplete").autocomplete({
source: $(".task-autocomplete").data("search-url"),
minLength: 2,
select: function(event, ui) {
var field = $(".task-autocomplete").data("dst-field");
$("input[name=" + field + "]").val(ui.item.id);
$("input[type=submit]").removeAttr('disabled');
}
});
}
});
})();