Merge pull request #85 from brianlow/selected-text-1

Run selected text. Implements sosedoff/pgweb#78.
This commit is contained in:
Dan Sosedoff 2015-05-18 16:20:38 -05:00
commit 6fd7b7d427

View File

@ -253,7 +253,7 @@ function runQuery() {
$("#run, #explain, #csv").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").prop("disabled", false);