Index: trunk/extensions/SemanticResultFormats/Filtered/skins/ext.srf.filtered.value-filter.css |
— | — | @@ -50,4 +50,8 @@ |
51 | 51 | right: 0pt; |
52 | 52 | text-align: center; |
53 | 53 | cursor: pointer; |
54 | | -} |
\ No newline at end of file |
| 54 | +} |
| 55 | + |
| 56 | +.filtered-filters .filtered-value .filtered-value-scrollable { |
| 57 | + overflow: auto; |
| 58 | +} |
Index: trunk/extensions/SemanticResultFormats/Filtered/filters/SRF_FF_Value.php |
— | — | @@ -60,6 +60,10 @@ |
61 | 61 | $ret['collapsible'] = trim($params['value filter collapsible']); |
62 | 62 | } |
63 | 63 | |
| 64 | + if ( array_key_exists( 'value filter height', $params ) ) { |
| 65 | + $ret['height'] = trim($params['value filter height']); |
| 66 | + } |
| 67 | + |
64 | 68 | return $ret; |
65 | 69 | } |
66 | 70 | |
Index: trunk/extensions/SemanticResultFormats/Filtered/libs/ext.srf.filtered.value-filter.js |
— | — | @@ -83,6 +83,7 @@ |
84 | 84 | var target = args.printout; |
85 | 85 | var switches = filtered.filtered( 'getFilterData', {filter: 'value', printout: target, configvar: 'switches'} ); |
86 | 86 | var collapsible = filtered.filtered( 'getFilterData', {filter: 'value', printout: target, configvar: 'collapsible'} ); |
| 87 | + var height = filtered.filtered( 'getFilterData', {filter: 'value', printout: target, configvar: 'height'} ); |
87 | 88 | |
88 | 89 | // find distinct values and set visibility for all items that have |
89 | 90 | // some value for this printout |
— | — | @@ -110,6 +111,39 @@ |
111 | 112 | // insert the label of the printout this filter filters on |
112 | 113 | filtercontrols.append('<div class="filtered-value-label"><span>' + values[i]['printouts'][target]['label'] + '</span></div>'); |
113 | 114 | |
| 115 | + if ( collapsible != null && ( collapsible == 'collapsed' || collapsible == 'uncollapsed') ) { |
| 116 | + var showControl = $('<span class="filtered-value-show">[+]</span>'); |
| 117 | + var hideControl = $('<span class="filtered-value-hide">[-]</span>'); |
| 118 | + |
| 119 | + |
| 120 | + filtercontrols |
| 121 | + .prepend(showControl) |
| 122 | + .prepend(hideControl); |
| 123 | + |
| 124 | + filtercontrols = $('<div class="filtered-value-collapsible">') |
| 125 | + .appendTo(filtercontrols); |
| 126 | + |
| 127 | + showControl.click(function(){ |
| 128 | + filtercontrols.slideDown(); |
| 129 | + showControl.hide(); |
| 130 | + hideControl.show(); |
| 131 | + }); |
| 132 | + |
| 133 | + hideControl.click(function(){ |
| 134 | + filtercontrols.slideUp(); |
| 135 | + showControl.show(); |
| 136 | + hideControl.hide(); |
| 137 | + }); |
| 138 | + |
| 139 | + if ( collapsible == 'collapsed' ) { |
| 140 | + hideControl.hide(); |
| 141 | + filtercontrols.slideUp(0); |
| 142 | + } else { |
| 143 | + showControl.hide(); |
| 144 | + } |
| 145 | + |
| 146 | + } |
| 147 | + |
114 | 148 | // set default config values |
115 | 149 | filtered.filtered( 'setFilterData', {filter: 'value', printout: target, configvar: 'use or', configvalue: true} ); |
116 | 150 | |
— | — | @@ -146,6 +180,15 @@ |
147 | 181 | |
148 | 182 | filtercontrols.append( switchControls ); |
149 | 183 | } |
| 184 | + |
| 185 | + if ( height != null ) { |
| 186 | + filtercontrols = $( '<div class="filtered-value-scrollable">' ) |
| 187 | + .appendTo( filtercontrols ); |
| 188 | + |
| 189 | + filtercontrols.height( height ); |
| 190 | + } |
| 191 | + |
| 192 | + |
150 | 193 | var sortedDistinctValues = []; |
151 | 194 | |
152 | 195 | for ( var i in distinctValues ) { |
— | — | @@ -174,39 +217,6 @@ |
175 | 218 | |
176 | 219 | } |
177 | 220 | |
178 | | - if ( collapsible != null && ( collapsible == 'collapsed' || collapsible == 'uncollapsed') ) { |
179 | | - var showControl = $('<span class="filtered-value-show">[+]</span>'); |
180 | | - var hideControl = $('<span class="filtered-value-hide">[-]</span>'); |
181 | | - |
182 | | - showControl.click(function(){ |
183 | | - filtercontrols.children('.filtered-value-collapsible').slideDown(); |
184 | | - showControl.hide(); |
185 | | - hideControl.show(); |
186 | | - }); |
187 | | - |
188 | | - hideControl.click(function(){ |
189 | | - filtercontrols.children('.filtered-value-collapsible').slideUp(); |
190 | | - showControl.show(); |
191 | | - hideControl.hide(); |
192 | | - }); |
193 | | - |
194 | | - filtercontrols |
195 | | - .prepend(showControl) |
196 | | - .prepend(hideControl) |
197 | | - |
198 | | - .children('.filtered-value-switches,.filtered-value-option') |
199 | | - .wrapAll( '<div class="filtered-value-collapsible">' ); |
200 | | - |
201 | | - if ( collapsible == 'collapsed' ) { |
202 | | - hideControl.hide(); |
203 | | - filtercontrols.children('.filtered-value-collapsible').slideUp(0); |
204 | | - } else { |
205 | | - showControl.hide(); |
206 | | - } |
207 | | - |
208 | | - |
209 | | - } |
210 | | - |
211 | 221 | return this; |
212 | 222 | }, |
213 | 223 | |