# HG changeset patch # User Katia Saurfelt # Date 1247042071 -7200 # Node ID 810fcd045f7c7a8935a408c392a78c6a0aa87d59 # Parent 017bc7d7552d0666c71b6fd7031c2180fd59e6dc # set right alt values, fix disapearing values in facetCheckBox diff -r 017bc7d7552d -r 810fcd045f7c web/data/cubicweb.formfilter.js --- a/web/data/cubicweb.formfilter.js Tue Jul 07 11:13:09 2009 +0200 +++ b/web/data/cubicweb.formfilter.js Wed Jul 08 10:34:31 2009 +0200 @@ -131,9 +131,11 @@ $this.find('img').each(function (i){ if (this.getAttribute('cubicweb:unselimg')){ this.setAttribute('src', UNSELECTED_BORDER_IMG); + this.setAttribute('alt', (_('not selected'))); } else{ this.setAttribute('src', UNSELECTED_IMG); + this.setAttribute('alt', (_('not selected'))); } }); var index = parseInt($this.attr('cubicweb:idx')); @@ -144,10 +146,11 @@ index += shift; var parent = this.parentNode; var $insertAfter = jQuery(parent).find('.facetCheckBox:nth('+index+')'); - if ( ! ($insertAfter.length == 1 && index == 0) ) { + if ( ! ($insertAfter.length == 1 && shift == 0) ) { // only rearrange element if necessary $insertAfter.after(this); - } + }else{ + } } else { var lastSelected = facet.find('.facetValueSelected:last'); if (lastSelected.length) { @@ -157,7 +160,10 @@ jQuery(parent).prepend(this); } jQuery(this).addClass('facetValueSelected'); - jQuery(this).find('img').attr('src', SELECTED_IMG); + var img = jQuery(this).find('img'); + img.attr('src', SELECTED_IMG); + img.attr('alt', (_('selected'))); + } buildRQL.apply(null, evalJSON(form.attr('cubicweb:facetargs'))); facet.find('.facetBody').animate({scrollTop: 0}, '');