Tag & search js cleanup
authorColeman Watts <coleman@civicrm.org>
Sat, 25 Jan 2014 06:23:12 +0000 (22:23 -0800)
committerColeman Watts <coleman@civicrm.org>
Sat, 25 Jan 2014 06:23:12 +0000 (22:23 -0800)
templates/CRM/Tag/Form/Tag.tpl
templates/CRM/common/pager.tpl

index cb04d2f3aab7a05fdf8233508573740579149ce4..a3af1786ef68bc9650813137b91db0627e351c8d 100644 (file)
  +--------------------------------------------------------------------+
 *}
 {* this template is used for adding/editing tags  *}
+{literal}
 <style>
-  .hit {ldelim}padding-left:10px;{rdelim}
-  .tree li {ldelim}padding-left:10px;{rdelim}
-  #Tag .tree .collapsable .hit {ldelim}background:url('{$config->resourceBase}i/menu-expanded.png') no-repeat left 8px;padding-left: 9px;cursor:pointer{rdelim}
-  #Tag .tree .expandable .hit {ldelim}background:url('{$config->resourceBase}i/menu-collapsed.png') no-repeat left 6px;padding-left: 9px;cursor:pointer{rdelim}
-  #Tag #tagtree .highlighted {ldelim}background-color:lightgrey;{rdelim}
+  #tagtree .highlighted > label {
+    background-color: #FEFD7B;
+  }
 </style>
 <script type="text/javascript">
-  (function($){ldelim}
+  (function($){{/literal}
     var entityID={$entityID};
     var entityTable='{$entityTable}';
     {literal}
     $(function() {
-      //unobsctructive elements are there to provide the function to those not having javascript, no need for the others
-      $(".unobstructive").hide();
-
       $("#tagtree ul input:checked").each (function(){
-        $(this).parents("li").children(".jstree-icon").addClass('highlighted');
+        $(this).closest("li").addClass('highlighted');
       });
 
       $("#tagtree input").change(function(){
@@ -49,6 +45,7 @@
         var op = (this.checked) ? 'create' : 'delete';
         var api = CRM.api3('entity_tag', op, {entity_table: entityTable, entity_id: entityID, tag_id: tagid});
         CRM.status({/literal}'{ts escape="js"}Saving...{/ts}', '{ts escape="js"}Saved{/ts}'{literal}, api);
+        $(this).closest("li").toggleClass('highlighted');
         CRM.updateContactSummaryTags();
       });
 
 </script>
 <div id="Tag" class="view-content">
   <h3>{if !$hideContext}{ts}Tags{/ts}{/if}</h3>
-  <p>
-  {if $action eq 16}
-    {if $permission EQ 'edit'}
-      {capture assign=crmURL}{crmURL p='civicrm/contact/view/tag' q='action=update'}{/capture}
-      <span class="unobstructive">{ts 1=$displayName 2=$crmURL}Current tags for <strong>%1</strong> are highlighted. You can add or remove tags from <a href='%2'>Edit Tags</a>.{/ts}</span>
-      {else}
-      {ts}Current tags are highlighted.{/ts}
-    {/if}
-    {else}
-    {if !$hideContext}
-      {ts}Mark or unmark the checkboxes, <span class="unobstructive">and click 'Update Tags' to modify tags.<span>{/ts}
-    {/if}
-  {/if}
-  </p>
   <div id="tagtree">
     <ul class="tree">
     {foreach from=$tree item="node" key="id"}
     {/foreach}
     </ul>
   </div>
-
-{* Show Edit Tags link if in View mode *}
-{if $permission EQ 'edit' AND $action eq 16}
-  </fieldset>
-  <div class="action-link unobstructive">
-    <a accesskey="N" href="{crmURL p='civicrm/contact/view/tag' q='action=update'}" class="button"><span><div class="icon edit-icon"></div>{ts}Edit Tags{/ts}</span></a>
-  </div>
-  {else}
-  <div class="form-item unobstructive">{$form.buttons.html}</div>
-  </fieldset>
-{/if}
   <br />
 {include file="CRM/common/Tag.tpl" context="contactTab"}
 </div>
index a3b7b75b0f9f8a7f910d9ede7c821a6cda1e6e3b..83f36e2f4fa1e1bac167b9b9fe4521720a272e70 100644 (file)
@@ -65,7 +65,7 @@
             currentPage = {$pager->_response.currentPage},
             perPageCount = {$pager->_perPage},
             currentLocation = {$pager->_response.currentLocation|json_encode},
-            spinning = null;
+            spinning = null,
             refreshing = false;
           {literal}
           function refresh(url) {