mirror of
https://github.com/TracksApp/tracks.git
synced 2025-09-22 05:50:47 +02:00
fix #1411 where the context list page was not adding new context on the page after the last was deleted.
This commit is contained in:
parent
9172d5e001
commit
549aa35e61
3 changed files with 8 additions and 1 deletions
|
@ -794,6 +794,9 @@ var ProjectListPage = {
|
|||
var ContextListPage = {
|
||||
update_state_count: function(state, count) {
|
||||
$('#'+state+'-contexts-count').html(count);
|
||||
if (count==0) {
|
||||
ContextListPage.set_empty_message(state, true);
|
||||
}
|
||||
},
|
||||
update_all_states_count: function (active_count, hidden_count, closed_count) {
|
||||
$(["active", "hidden", "closed"]).each(function() {
|
||||
|
@ -807,6 +810,10 @@ var ContextListPage = {
|
|||
});
|
||||
},
|
||||
hide_empty_message: function(state, set_visible) {
|
||||
// TODO: wrong method name. refactor to remove this method
|
||||
set_empty_message(state, set_visible);
|
||||
},
|
||||
set_empty_message: function(state, set_visible) {
|
||||
if(set_visible) {
|
||||
$('div#'+state+'-contexts-empty-nd').slideDown("fast");
|
||||
} else {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
remove_deleted_context();
|
||||
|
||||
ContextListPage.update_all_states_count(<%=@active_contexts_count%>, <%=@hidden_contexts_count%>, <%=@closed_contexts_count%>)
|
||||
ContextListPage.show_or_hide_all_state_containers(<%= @show_active_contexts %>, <%= @show_hidden_contexts %>, <%= @show_closed_contexts %>);
|
||||
|
||||
TracksPages.set_page_badge(<%=@down_count%>);
|
||||
TracksPages.page_notify('notice', "<%= t('contexts.context_deleted', :name=>@context.name)%>", 5);
|
||||
|
|
|
@ -684,6 +684,7 @@ en:
|
|||
context_state: Context state
|
||||
hidden_contexts: Hidden contexts
|
||||
no_contexts_active: Currently there are no active contexts
|
||||
no_contexts_closed: Currently there are no closed contexts
|
||||
show_form: Create a new context
|
||||
visible_contexts: Visible contexts
|
||||
save_status_message: Context saved
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue