Merge pull request #198 from gallifabio/feature/favor-selected-text

Explain and Export: favor selected text
This commit is contained in:
Dan Sosedoff 2016-11-09 10:10:44 -06:00 committed by GitHub
commit 474c439076
2 changed files with 27 additions and 27 deletions

File diff suppressed because one or more lines are too long

View File

@ -563,7 +563,7 @@ function runExplain() {
$("#run, #explain, #csv, #json, #xml").prop("disabled", true);
$("#query_progress").show();
var query = $.trim(editor.getValue());
var query = $.trim(editor.getSelectedText() || editor.getValue());
if (query.length == 0) {
$("#run, #explain, #csv, #json, #xml").prop("disabled", false);
@ -583,7 +583,7 @@ function runExplain() {
}
function exportTo(format) {
var query = $.trim(editor.getValue());
var query = $.trim(editor.getSelectedText() || editor.getValue());
if (query.length == 0) {
return;