Skip to content

Commit ada8bb9

Browse files
authored
Fix query not switching when only the context is different
if the selected query has the same query but different context as described in issue #87 the context would not update. with this additional check to see if the context differs as well both get updated. Closes #87
1 parent ef2a28a commit ada8bb9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ldf-client-ui.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,10 @@ if (typeof global.process === 'undefined')
208208
});
209209
$queries.chosen({ skip_no_results: true, placeholder_text: ' ' });
210210
$queries.change(function (query) {
211-
if ((options.query !== $queries.val()) && (query = $queries.val())) {
211+
var queryContext = $queries.find(':selected').attr('queryContext');
212+
if ((options.query !== $queries.val() || options.queryContext !== queryContext) && (query = $queries.val())) {
212213
// Set the query text
213214
self._setOption('queryFormat', $queries.find(':selected').attr('queryFormat'));
214-
var queryContext = $queries.find(':selected').attr('queryContext');
215215
if ($queryContextsIndexed[options.queryFormat])
216216
$queryContextsIndexed[options.queryFormat].val(options.queryContext = queryContext).edited = false;
217217
$queryTextsIndexed[options.queryFormat].val(options.query = query).edited = false;

0 commit comments

Comments
 (0)