Changeset 29444 for main/trunk/model-sites-dev
- Timestamp:
- 2014-11-17T16:16:35+13:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-sites-dev/von-sparql/js/von-sparql-comparison-setup.js
r29434 r29444 62 62 63 63 //Draw buttons, etc for each side of page 64 drawSide("left" ,leftCollection);65 apply_functions("left" ,leftCollection);66 drawSide("right" ,rightCollection);67 apply_functions("right" ,rightCollection);64 drawSide("left"); 65 apply_functions("left"); 66 drawSide("right"); 67 apply_functions("right"); 68 68 69 69 //apply css to generated objects … … 100 100 101 101 //Redraw a side, given the collection name 102 function drawSide(side, collectionName){ 102 function drawSide(side){ 103 var collectionName = $("#sel_" + side + "Collection").val(); 103 104 $('#span_' + side + 'Name').html(collectionName); 104 105 drawOverview(collectionName, ("div_" + side + "Overview")); … … 186 187 187 188 //Apply functions to various elements 188 function apply_functions(side , collection){189 function apply_functions(side){ 189 190 190 191 //Create jquery UI comboboxes 191 192 $('#div_' + side + 'RefineControls select').combobox({ 192 193 select: function(event, ui) { 194 var collectionValue = $("#sel_" + side + "Collection").val(); 193 195 var id = event.target.id; 194 196 if(id == "sel_" + side + "Predicate") 195 updateValueSelector(this.value,"sel_"+ side + "PredicateValue", collection );197 updateValueSelector(this.value,"sel_"+ side + "PredicateValue", collectionValue); 196 198 } 197 199 }); … … 199 201 $('#btn_' + side + 'ShowChart').on('click',function(){ 200 202 hardLimit=2000; 201 drawFilteredDataset(side, collection); 203 var collectionValue = $("#sel_" + side + "Collection").val(); 204 drawFilteredDataset(side, collectionValue); 202 205 }); 203 206 204 207 $('#btn_' + side + 'ShowQuery').on('click',function(){ 208 var collectionValue = $("#sel_" + side + "Collection").val(); 205 209 hardLimit=2000; 206 alert(generateQuery(side,collection ));210 alert(generateQuery(side,collectionValue)); 207 211 }); 208 212 … … 215 219 216 220 //When a <tr> in overview table is selected, select in predicate dropdown 217 $(document).on("click", "#div_" + side + "Overview.overview tr", function(){ 221 $(document).on("click", "#div_" + side + "Overview.overview tr", function(){ 222 var collectionValue = $("#sel_" + side + "Collection").val(); 218 223 var clickedText = tidyPredicate($(this).children(":first").text()); 219 224 $('#sel_' + side + 'Predicate option[text="' + clickedText + '"]').attr('selected','selected'); … … 223 228 224 229 $('#sel_' + side + 'Predicate').siblings('.custom-combobox').find('.custom-combobox-input').val(clickedText); 225 updateValueSelector($('#sel_' + side + 'Predicate option:selected').val(),"sel_"+ side + "PredicateValue", collection );230 updateValueSelector($('#sel_' + side + 'Predicate option:selected').val(),"sel_"+ side + "PredicateValue", collectionValue); 226 231 227 232 if($('#cb_quickSearch').is(':checked')) { 228 233 hardLimit=500; 229 drawFilteredDataset(side, collection );234 drawFilteredDataset(side, collectionValue); 230 235 } 231 236
Note:
See TracChangeset
for help on using the changeset viewer.