[bijiben] Focus new notes
- From: Pierre-Yves Luyten <pyluyten src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [bijiben] Focus new notes
- Date: Sun, 20 Apr 2014 19:09:45 +0000 (UTC)
commit 16ffc8abf9930fb0e670f65d8e3581e6379ab978
Author: Chunyang Xu <xuchunyang56 gmail com>
Date: Sun Apr 20 21:05:32 2014 +0200
Focus new notes
Fixes #699249 for new notes.
src/libbiji/editor/biji-webkit-editor.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/libbiji/editor/biji-webkit-editor.c b/src/libbiji/editor/biji-webkit-editor.c
index a85c2e8..50487ed 100644
--- a/src/libbiji/editor/biji-webkit-editor.c
+++ b/src/libbiji/editor/biji-webkit-editor.c
@@ -350,7 +350,15 @@ biji_webkit_editor_constructed (GObject *obj)
body = biji_note_obj_get_html (priv->note);
if (!body)
- body = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><body></body></html>";
+ body = "<html xmlns='http://www.w3.org/1999/xhtml'>"
+ "<body contenteditable='true' id='editable'>"
+ "<script type='text/javascript'>"
+ " window.onload = function() {"
+ " document.getElementById('editable').focus();"
+ " };"
+ "</script>"
+ "</body>"
+ "</html>";
webkit_web_view_load_string (view, body, "application/xhtml+xml", NULL, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]