From: Coleman Watts Date: Mon, 6 Feb 2017 18:03:02 +0000 (-0500) Subject: CRM-19943 - Add deselect button X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=3a1b611ac6c984a69cee71ec86a842613599de36;p=civicrm-core.git CRM-19943 - Add deselect button --- diff --git a/templates/CRM/Tag/Page/Tag.tpl b/templates/CRM/Tag/Page/Tag.tpl index 374fbb8895..2a522df4c5 100644 --- a/templates/CRM/Tag/Page/Tag.tpl +++ b/templates/CRM/Tag/Page/Tag.tpl @@ -141,6 +141,11 @@ $infoBox.trigger('crmLoad'); } + function clearSelection(e) { + e.preventDefault(); + $('.tag-tree', $panel).jstree(true).deselect_all(); + } + function changeUsedFor() { var vals = $('input[name=used_for]:checked', $panel).map(function(i, el) { return $(el).val(); @@ -191,6 +196,7 @@ .append('
') .on('change', 'input[type=color]', changeColor) .on('change', 'input[name=used_for]', changeUsedFor) + .on('click', '.clear-tag-selection', clearSelection) .on('click', '.used-for-toggle', function() { $(this).attr('style', 'display: none !important;').next().show(); }) @@ -305,6 +311,17 @@ box-sizing: border-box; background: white; } + div.tag-info .clear-tag-selection { + position: absolute; + top: 10px; + right: 12px; + color: inherit; + opacity: .5; + } + div.tag-info .clear-tag-selection:hover, + div.tag-info .clear-tag-selection:active { + opacity: 1; + } .tag-tree-wrapper .tag-tree a.crm-tag-item { border-radius: 3px; margin: 2px 0; @@ -333,6 +350,9 @@ div.tag-info .crm-editable-enabled[data-field=description] { min-width: 60%; } + div.tag-info input[type=color] { + cursor: pointer; + } div.tag-info .tdl { font-weight: bold; color: #999; @@ -409,6 +429,7 @@ <% {rdelim} %>
{ts}Usage Count:{/ts} <%= data.usages %>
+
<% if(!tagset) {ldelim} %> @@ -434,6 +455,7 @@

* {ts 1="<%= reserved %>"}%1 reserved.{/ts}

<% {rdelim} %>

{ts}Total Usage:{/ts} <%= usages %>

+