@@ -145,6 +145,9 @@ require('yasgui-yasqe/dist/yasqe.css'); // Make webpack import the css as well
145
145
// Update YASQE editor if applicable
146
146
if ( $query . yasqe && $query . yasqe . getValue ( ) !== options . query )
147
147
$query . yasqe . setValue ( options . query ) ;
148
+
149
+ // Load the transient datasources for the current query
150
+ self . _setSelectedDataSourcesForQuery ( ) ;
148
151
} ;
149
152
150
153
// Prettify SPARQL editors with YASQE
@@ -364,11 +367,7 @@ require('yasgui-yasqe/dist/yasqe.css'); // Make webpack import the css as well
364
367
// Set the list of all possible queries
365
368
case 'queries' :
366
369
// Load the transient datasources for the current query
367
- var queryId = this . _getSelectedQueryId ( ) ;
368
- if ( queryId >= 0 ) {
369
- var newDatasources = this . _getHashedQueryDatasources ( this . _getSelectedQueryId ( ) ) ;
370
- self . _setOption ( 'selectedDatasources' , newDatasources ) ;
371
- }
370
+ this . _setSelectedDataSourcesForQuery ( ) ;
372
371
373
372
// Set the queries applicable to the set datasources
374
373
value . forEach ( function ( query ) {
@@ -455,6 +454,15 @@ require('yasgui-yasqe/dist/yasqe.css'); // Make webpack import the css as well
455
454
return persistedDatasources ;
456
455
} ,
457
456
457
+ // Set the default datasources based on the currently selected query
458
+ _setSelectedDataSourcesForQuery : function ( ) {
459
+ var queryId = this . _getSelectedQueryId ( ) ;
460
+ if ( queryId >= 0 ) {
461
+ var newDatasources = this . _getHashedQueryDatasources ( this . _getSelectedQueryId ( ) ) ;
462
+ this . _setOption ( 'selectedDatasources' , newDatasources ) ;
463
+ }
464
+ } ,
465
+
458
466
// Get the query id of the given query
459
467
_getSelectedQueryId : function ( ) {
460
468
var queryId = - 1 ;
0 commit comments