Skip to content

Commit

Permalink
Frontend: Execute only selected query text
Browse files Browse the repository at this point in the history
Earlier approach was to execute everything in the editor. With this new
approach, only selected text is treated as query and executed on the
server
  • Loading branch information
smurfpandey committed Feb 23, 2015
1 parent 97518b8 commit 367933f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion static/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,16 @@ function runQuery(editor) {

$("#query_progress").show();

var query = $.trim(editor.getValue());
var query = ''; //$.trim(editor.getValue());

//Check if text is selected.
//If yes, then execute that selectionm only;

var selectedText = editor.session.getTextRange(editor.getSelectionRange());

if (selectedText.length > 0) {
query = selectedText;
}

if (query.length === 0) {
$("#query_progress").hide();
Expand Down

0 comments on commit 367933f

Please sign in to comment.