web/data/cubicweb.facets.js
changeset 8216 99ff746e8de8
parent 8185 864fc1f147a4
child 8260 5a81fa526b30
equal deleted inserted replaced
8214:ce9556358dbd 8216:99ff746e8de8
   179                     if ($this.hasClass('facetValueSelected')) {
   179                     if ($this.hasClass('facetValueSelected')) {
   180                         $this.removeClass('facetValueSelected');
   180                         $this.removeClass('facetValueSelected');
   181                         $this.find('img').each(function(i) {
   181                         $this.find('img').each(function(i) {
   182                             if (this.getAttribute('cubicweb:unselimg')) {
   182                             if (this.getAttribute('cubicweb:unselimg')) {
   183                                 this.setAttribute('src', UNSELECTED_BORDER_IMG);
   183                                 this.setAttribute('src', UNSELECTED_BORDER_IMG);
   184                                 this.setAttribute('alt', (_('not selected')));
   184                                 this.setAttribute('alt', (_("not selected")));
   185                             }
   185                             }
   186                             else {
   186                             else {
   187                                 this.setAttribute('src', UNSELECTED_IMG);
   187                                 this.setAttribute('src', UNSELECTED_IMG);
   188                                 this.setAttribute('alt', (_('not selected')));
   188                                 this.setAttribute('alt', (_("not selected")));
   189                             }
   189                             }
   190                         });
   190                         });
   191                         var index = parseInt($this.attr('cubicweb:idx'));
   191                         var index = parseInt($this.attr('cubicweb:idx'));
   192                         // we dont need to move the element when cubicweb:idx == 0
   192                         // we dont need to move the element when cubicweb:idx == 0
   193                         if (index > 0) {
   193                         if (index > 0) {
   211                             var parent = this.parentNode;
   211                             var parent = this.parentNode;
   212                             jQuery(parent).prepend(this);
   212                             jQuery(parent).prepend(this);
   213                         }
   213                         }
   214                         jQuery(this).addClass('facetValueSelected');
   214                         jQuery(this).addClass('facetValueSelected');
   215                         var $img = jQuery(this).find('img');
   215                         var $img = jQuery(this).find('img');
   216                         $img.attr('src', SELECTED_IMG).attr('alt', (_('selected')));
   216                         $img.attr('src', SELECTED_IMG).attr('alt', (_("selected")));
   217                     }
   217                     }
   218                     buildRQL.apply(null, jsfacetargs);
   218                     buildRQL.apply(null, jsfacetargs);
   219                     facet.find('.facetBody').animate({
   219                     facet.find('.facetBody').animate({
   220                         scrollTop: 0
   220                         scrollTop: 0
   221                     },
   221                     },