Selecting the text in the search input on searchbar activation

This commit is contained in:
Brian Smith 2015-10-30 20:20:20 -06:00
parent a02d4859b5
commit 5e396a7f78
2 changed files with 9 additions and 4 deletions

View file

@ -43,6 +43,10 @@
background-color: @background;
color: @foreground;
font-size: 12px;
&::selection {
background: mix(@accent, #ccc, 15%);
}
}
button {

View file

@ -139,7 +139,7 @@ define([
var options = this.currentSearch;
chrome.fileSystem.getDisplayPath(nodeEntry, function(path) {
if (!options.running) return c();
if (!options.running) return c();
var file = new File(nodeEntry);
var path = nodeEntry.fullPath;
@ -233,13 +233,14 @@ define([
},
activate: function(mode) {
var highlighted = editor.getSelectedText();
if (highlighted) {
this.input.value = highlighted;
var selected = editor.getSelectedText();
if (selected) {
this.input.value = selected;
}
this.element.addClass("active");
this.input.focus();
this.input.select();
},
deactivate: function(cancel) {