summaryrefslogtreecommitdiff
path: root/assets/js/src
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-02-04 21:38:53 -0500
committerFrederic Guillot <fred@kanboard.net>2016-02-04 21:38:53 -0500
commit0f2b46dd6a9a1dc17768de2c415f382df95142e8 (patch)
tree55191fce45c7c06b7d2b45834ea4151745c3db77 /assets/js/src
parent346151e103431e8de12520b26daae10676b8faf5 (diff)
Do not refresh the whole page when changing subtask status (work in progress)
Diffstat (limited to 'assets/js/src')
-rw-r--r--assets/js/src/App.js13
-rw-r--r--assets/js/src/Tooltip.js15
2 files changed, 13 insertions, 15 deletions
diff --git a/assets/js/src/App.js b/assets/js/src/App.js
index 0ae437c0..cd5df66e 100644
--- a/assets/js/src/App.js
+++ b/assets/js/src/App.js
@@ -41,6 +41,19 @@ App.prototype.listen = function() {
this.autoComplete();
this.datePicker();
this.focus();
+
+ $(document).on("click", ".ajax-replace", function(e) {
+ e.preventDefault();
+ var el = $(this);
+
+ $.ajax({
+ cache: false,
+ url: el.attr("href"),
+ success: function(data) {
+ el.replaceWith(data);
+ }
+ });
+ });
};
App.prototype.refresh = function() {
diff --git a/assets/js/src/Tooltip.js b/assets/js/src/Tooltip.js
index 0ec8b268..f3ef55f9 100644
--- a/assets/js/src/Tooltip.js
+++ b/assets/js/src/Tooltip.js
@@ -48,21 +48,6 @@ Tooltip.prototype.listen = function() {
var position = $(_this).tooltip("option", "position");
position.of = $(_this);
tooltip.position(position);
-
- // Toggle subtasks status
- $('#tooltip-subtasks a').not(".popover").click(function(e) {
-
- e.preventDefault();
- e.stopPropagation();
-
- if ($(this).hasClass("popover-subtask-restriction")) {
- self.app.popover.open($(this).attr('href'));
- $(_this).tooltip('close');
- }
- else {
- $.get($(this).attr('href'), setTooltipContent);
- }
- });
});
return '<i class="fa fa-spinner fa-spin"></i>';