Changeset 29760 for trunk/admin/themes


Ignore:
Timestamp:
Sep 23, 2014, 11:28:26 AM (10 years ago)
Author:
mistic100
Message:

filter "dissociate" action + display bug of Selectize widget

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/themes/default/template/batch_manager_global.tpl

    r29619 r29760  
    4444    rootUrl: '{$ROOT_URL}'
    4545  });
     46 
     47  var associated_categories = {$associated_categories|@json_encode};
    4648
    4749  categoriesCache.selectize(jQuery('[data-selectize=categories]'), {
     
    4951      if (this.name == 'dissociate') {
    5052        var filtered = jQuery.grep(categories, function(cat) {
    51           return !cat.dir;
     53          return !!associated_categories[cat.id];
    5254        });
    5355
    5456        if (filtered.length > 0) {
    55           jQuery('.albumDissociate').show();
    5657          options.default = filtered[0].id;
    5758        }
     
    553554      <option value="associate">{'Associate to album'|@translate}</option>
    554555      <option value="move">{'Move to album'|@translate}</option>
    555       <option value="dissociate" class="albumDissociate" style="display:none">{'Dissociate from album'|@translate}</option>
     556  {if !empty($associated_categories)}
     557      <option value="dissociate">{'Dissociate from album'|@translate}</option>
     558  {/if}
    556559      <option value="add_tags">{'Add tags'|@translate}</option>
    557560  {if !empty($associated_tags)}
     
    598601
    599602    <!-- dissociate -->
    600     <div id="action_dissociate" class="bulkAction albumDissociate" style="display:none">
     603    <div id="action_dissociate" class="bulkAction">
    601604      <select data-selectize="categories" placeholder="{'Type in a search term'|translate}"
    602605        name="dissociate" style="width:600px"></select>
Note: See TracChangeset for help on using the changeset viewer.