From 385b4156763df953b6270dc1002b296aed9e014a Mon Sep 17 00:00:00 2001 From: brianlow Date: Mon, 18 May 2015 14:58:03 -0600 Subject: [PATCH] Run selected text. Implements sosedoff/pgweb#78. In the Query tab, only run the selected text. If nothing selected, run all text in the editor. --- static/js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/app.js b/static/js/app.js index a104d93..51b8c49 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -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);