[Bps-public-commit] rt-extension-automaticassignment branch, master, updated. 0c506f3d5c5190f82b48335ffb7df6972f05abb9
Shawn Moore
shawn at bestpractical.com
Wed Aug 17 15:22:07 EDT 2016
The branch, master has been updated
via 0c506f3d5c5190f82b48335ffb7df6972f05abb9 (commit)
from 78f79c4746d6b7acba9f6acd052e43403d6e22f6 (commit)
Summary of changes:
html/Admin/Queues/Elements/SortableBox | 8 +++++++-
static/css/automatic-assignment.css | 4 ++++
static/js/automatic-assignment.js | 7 +++++++
3 files changed, 18 insertions(+), 1 deletion(-)
- Log -----------------------------------------------------------------
commit 0c506f3d5c5190f82b48335ffb7df6972f05abb9
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Wed Aug 17 19:22:21 2016 +0000
Add a remove (x) button
diff --git a/html/Admin/Queues/Elements/SortableBox b/html/Admin/Queues/Elements/SortableBox
index f236351..a8b0a81 100644
--- a/html/Admin/Queues/Elements/SortableBox
+++ b/html/Admin/Queues/Elements/SortableBox
@@ -1,7 +1,11 @@
<div data-prefix="<% $prefix %>" class="sortable-box">
<input type="hidden" class="hidden" name="<% $prefix %>" value="1" />
<input type="hidden" class="hidden" name="<% $prefix %>_ClassName" value="<% $class_name %>" />
-<h3><% $class->Description %></h3>
+<h3><% $class->Description %>
+% if ($allow_remove) {
+<a href="#" class="remove">(x)</a>
+% }
+</h3>
<div class="inner">
<% $m->content | n %>
</div>
@@ -19,6 +23,8 @@ unless ($class->require) {
RT->Logger->error("Couldn't load class '$class': $@");
$m->abort;
}
+
+my $allow_remove = $is_filter;
</%INIT>
<%ARGS>
$is_filter
diff --git a/static/css/automatic-assignment.css b/static/css/automatic-assignment.css
index 4788728..5363f77 100644
--- a/static/css/automatic-assignment.css
+++ b/static/css/automatic-assignment.css
@@ -39,3 +39,7 @@ form.automatic-assignment {
.chooser.replacing .loading {
visibility: visible;
}
+
+.sortable-box .remove {
+ float: right;
+}
diff --git a/static/js/automatic-assignment.js b/static/js/automatic-assignment.js
index cd7041a..aaf2081 100644
--- a/static/js/automatic-assignment.js
+++ b/static/js/automatic-assignment.js
@@ -75,5 +75,12 @@ jQuery(function () {
}
});
});
+
+ form.on('click', '.sortable-box .remove', function () {
+ jQuery(this).closest('.sortable-box').slideUp(400, function () {
+ jQuery(this).remove();
+ refreshFiltersField();
+ });
+ });
});
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list