From b2c343ec0e18f9cb371da4b0d8169f3c89593c37 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Mon, 12 Sep 2016 23:19:16 +0200 Subject: [PATCH] Improve add group's categorie user interface --- inc/myco.js | 3 +++ index.html | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/inc/myco.js b/inc/myco.js index cc0a5e5..d4f84f3 100644 --- a/inc/myco.js +++ b/inc/myco.js @@ -307,6 +307,7 @@ on_categories_go_back_group_btn_click=function(e) { } on_categories_group_add_btn_click=function(e) { + e.preventDefault(); name=$('#add_category input')[0].value; if (jQuery.type(name)!='string' || name=='') { @@ -322,6 +323,7 @@ on_categories_group_add_btn_click=function(e) { group.addCategory(new Category(name)); $('#add_category input')[0].value=''; refresh_group_categories(group); + $('#add_category input').focus(); } } @@ -1077,6 +1079,7 @@ $( document ).ready( function() { $('#nav-search-form input').bind('input',on_nav_search_form_input); $('#view-group-categories span.input-group-addon').bind('click',on_categories_group_add_btn_click); + $('#view-group-categories form').bind('submit',on_categories_group_add_btn_click); $("#view-group-categories button.go-back-group").bind('click',on_categories_go_back_group_btn_click); view_home(); diff --git a/index.html b/index.html index 2ceabbb..14196b5 100644 --- a/index.html +++ b/index.html @@ -339,10 +339,12 @@ span.cat-color {
-
- - -
+
+
+ + +
+