Improve add group's categorie user interface

This commit is contained in:
Benjamin Renard 2016-09-12 23:19:16 +02:00
parent da6aab0146
commit b2c343ec0e
2 changed files with 9 additions and 4 deletions

View file

@ -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();

View file

@ -339,10 +339,12 @@ span.cat-color {
<div class='col-xs-6'>
<ul>
</ul>
<div id="add_category" class='input-group'>
<input type='text' class="form-control" placeholder='nom'/>
<span class="input-group-addon"><span class="glyphicon glyphicon-plus"></span></span>
</div>
<form class="form-horizontal" role="form">
<div id="add_category" class='input-group'>
<input type='text' class="form-control" placeholder='nom'/>
<span class="input-group-addon"><span class="glyphicon glyphicon-plus"></span></span>
</div>
</form>
</div>
</div>
<div id='cats-chart'></div>