Improve add group's categorie user interface
This commit is contained in:
parent
da6aab0146
commit
b2c343ec0e
2 changed files with 9 additions and 4 deletions
|
@ -307,6 +307,7 @@ on_categories_go_back_group_btn_click=function(e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
on_categories_group_add_btn_click=function(e) {
|
on_categories_group_add_btn_click=function(e) {
|
||||||
|
e.preventDefault();
|
||||||
name=$('#add_category input')[0].value;
|
name=$('#add_category input')[0].value;
|
||||||
|
|
||||||
if (jQuery.type(name)!='string' || name=='') {
|
if (jQuery.type(name)!='string' || name=='') {
|
||||||
|
@ -322,6 +323,7 @@ on_categories_group_add_btn_click=function(e) {
|
||||||
group.addCategory(new Category(name));
|
group.addCategory(new Category(name));
|
||||||
$('#add_category input')[0].value='';
|
$('#add_category input')[0].value='';
|
||||||
refresh_group_categories(group);
|
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);
|
$('#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 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-group-categories button.go-back-group").bind('click',on_categories_go_back_group_btn_click);
|
||||||
|
|
||||||
view_home();
|
view_home();
|
||||||
|
|
10
index.html
10
index.html
|
@ -339,10 +339,12 @@ span.cat-color {
|
||||||
<div class='col-xs-6'>
|
<div class='col-xs-6'>
|
||||||
<ul>
|
<ul>
|
||||||
</ul>
|
</ul>
|
||||||
<div id="add_category" class='input-group'>
|
<form class="form-horizontal" role="form">
|
||||||
<input type='text' class="form-control" placeholder='nom'/>
|
<div id="add_category" class='input-group'>
|
||||||
<span class="input-group-addon"><span class="glyphicon glyphicon-plus"></span></span>
|
<input type='text' class="form-control" placeholder='nom'/>
|
||||||
</div>
|
<span class="input-group-addon"><span class="glyphicon glyphicon-plus"></span></span>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id='cats-chart'></div>
|
<div id='cats-chart'></div>
|
||||||
|
|
Loading…
Reference in a new issue