r113250 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113249‎ | r113250 | r113251 >
Date:17:29, 7 March 2012
Author:foxtrott
Status:deferred
Tags:
Comment:
bugfix ('and' filter)
Modified paths:
  • /trunk/extensions/SemanticResultFormats/Filtered/libs/ext.srf.filtered.value-filter.js (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticResultFormats/Filtered/libs/ext.srf.filtered.value-filter.js
@@ -49,10 +49,19 @@
5050 } else {
5151 var selected = ( printoutValues.length > 0 );
5252
53 - for ( var j in printoutValues ) {
 53+ if ( selected ) {
 54+ // try to find each required value
 55+ selectedInputs.each(function(){
5456
55 - selectedInputs.each(function(){
56 - selected = selected && ( printoutValues[j] == $(this).attr('value') );
 57+ var selectedFoundInPrintout = false;
 58+ for ( var j in printoutValues ) {
 59+ selectedFoundInPrintout = selectedFoundInPrintout || ( printoutValues[j] == $(this).attr('value') );
 60+
 61+ if ( selectedFoundInPrintout ) {
 62+ break;
 63+ }
 64+ }
 65+ selected = selected && selectedFoundInPrintout;
5766 });
5867 }
5968 }
@@ -101,7 +110,7 @@
102111 filtercontrols.append('<div class="filtered-value-label"><span>' + values[i]['printouts'][target]['label'] + '</span></div>');
103112
104113 // set default config values
105 - filtered.filtered( 'setFilterData', {filter: 'value', printout: target, configvar: 'use or', configvalue: true } );
 114+ filtered.filtered( 'setFilterData', {filter: 'value', printout: target, configvar: 'use or', configvalue: true} );
106115
107116
108117 // insert switches