summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-11-08 12:09:00 (EST)
committer Patrick McDermott <pj@pehjota.net>2017-11-08 12:09:00 (EST)
commit7d72554c991c4a2f431293a5791f0fb6805fce1d (patch)
tree8250535a33508f9aea9ae31aab4d6ae594ad4a96 /src
parent05904c6e9fa9d433d1c0c48b5ad4af6bdc0121a8 (diff)
downloadmarquee-7d72554c991c4a2f431293a5791f0fb6805fce1d.zip
marquee-7d72554c991c4a2f431293a5791f0fb6805fce1d.tar.gz
marquee-7d72554c991c4a2f431293a5791f0fb6805fce1d.tar.bz2
about:profiles: Focus on name <input> on "Edit" button click
Diffstat (limited to 'src')
-rw-r--r--src/schemes/about/profiles.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/schemes/about/profiles.c b/src/schemes/about/profiles.c
index d5e3d61..ede57c7 100644
--- a/src/schemes/about/profiles.c
+++ b/src/schemes/about/profiles.c
@@ -186,6 +186,7 @@ static const gchar *cp_script =
"var radio = parent.querySelector(\"input[type=radio]\");\n"
"var svg = parent.querySelector(\"svg\");\n"
"var colorInput = parent.querySelector(\"input[type=hidden]\");\n"
+ "var nameInput = parent.querySelector(\"input[type=text]\");\n"
"var cpDiv = parent.querySelector(\"div.color-picker\");\n"
"var slide = cpDiv.querySelector(\"div.slide\");\n"
"var slideInd = cpDiv.querySelector(\"div.slide-indicator\");\n"
@@ -207,6 +208,7 @@ static const gchar *cp_script =
" for (var i = 0; i < cps.length; ++i) {\n"
" cps[i].style.display = \"none\";\n"
" }\n"
+ " nameInput.focus();\n"
"});\n"
"svg.addEventListener(\"click\", function (event) {\n"
" if (radio.checked) {\n"
@@ -294,10 +296,10 @@ generate_div(MqProfiles *profiles, gchar *id)
NULL),
mq_html_buttonbox(NULL, "OK", NULL, "Cancel"),
NULL),
- mq_html_container("script", NULL, g_strdup(cp_script), NULL),
mq_html_container("span", is_current ? "current" : NULL, name,
NULL),
mq_html_input_text(name_str, NULL, name, id == NULL),
+ mq_html_container("script", NULL, g_strdup(cp_script), NULL),
mq_html_submit(launch_str, "Launch", FALSE),
mq_html_submit(default_str, "Make Default",
!id || mq_profiles_is_default(profiles, id)),