Skip to content

Commit

Permalink
Preselect text
Browse files Browse the repository at this point in the history
  • Loading branch information
zevero committed Oct 11, 2015
1 parent 5bbf3ef commit 720e7df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nbproject
bower_components
npm_modules
2 changes: 1 addition & 1 deletion jquery_html_editable.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
var $el = $(this).hide();
var $textarea = $('<textarea>').addClass('html_editable_').text($el.text());
$el.after($textarea);
$textarea.css({minHeight: $textarea[0].rows+1+'em', overflow:'hidden'}).focus();
$textarea.css({minHeight: $textarea[0].rows+1+'em', overflow:'hidden'}).focus().select();
});
this.on('blur',target + ' + textarea.html_editable_', function() { //on blur write everything back
var $textarea = $(this);
Expand Down

0 comments on commit 720e7df

Please sign in to comment.