diff --git a/app/assets/images/collapse.png b/app/assets/images/collapse.png deleted file mode 100644 index c926682f..00000000 Binary files a/app/assets/images/collapse.png and /dev/null differ diff --git a/app/assets/images/collapse_expand.png b/app/assets/images/collapse_expand.png new file mode 100644 index 00000000..4a8efd14 Binary files /dev/null and b/app/assets/images/collapse_expand.png differ diff --git a/app/assets/images/expand.png b/app/assets/images/expand.png deleted file mode 100644 index 848d8ff2..00000000 Binary files a/app/assets/images/expand.png and /dev/null differ diff --git a/app/assets/javascripts/tracks.js b/app/assets/javascripts/tracks.js index 36e90ebd..5f93519e 100644 --- a/app/assets/javascripts/tracks.js +++ b/app/assets/javascripts/tracks.js @@ -328,51 +328,24 @@ var TodoItemsContainer = { ensureVisibleWithEffectAppear: function(elemId){ $('#'+elemId).fadeIn(500); }, - expandNextActionListing: function(itemsElem, skipAnimation) { - itemsElem = $(itemsElem); - if(skipAnimation == true) { - itemsElem.show(); - } - else { - itemsElem.show('blind', 400); - } - TodoItems.showContainer(itemsElem.parentNode); - }, - collapseNextActionListing: function(itemsElem, skipAnimation) { - itemsElem = $(itemsElem); - if(skipAnimation == true) { - itemsElem.hide(); - } - else { - itemsElem.hide('blind', 400); - } - TodoItems.hideContainer(itemsElem.parentNode); - }, ensureContainerHeight: function(itemsElem) { $(itemsElem).css({ height: '', overflow: '' }); }, - expandNextActionListingByContext: function(itemsElemId, skipAnimation){ - TodoItems.expandNextActionListing($('#'+itemsElemId).get(), skipAnimation); - }, setup_container_toggles: function(){ // bind handlers $('.container_toggle').click(function(evt){ var toggle_target = $(this.parentNode.parentNode).find('.toggle_target'); if(toggle_target.is(':visible')){ // hide it - var imgSrc = $(this).find('img').attr('src'); - $(this).find('img').attr('src', imgSrc.replace('collapse', 'expand')); $.cookie(TodoItemsContainer.buildCookieName(this.parentNode.parentNode), true); toggle_target.slideUp(500); // set parent class to 'context_collapsed' so we can hide/unhide all collapsed contexts toggle_target.parent().addClass("context_collapsed"); } else { // show it - imgSrc = $(this).find('img').attr('src'); - $(this).find('img').attr('src', imgSrc.replace('expand', 'collapse')); $.cookie(TodoItemsContainer.buildCookieName(this.parentNode.parentNode), null); toggle_target.slideDown(500); // remove class 'context_collapsed' from parent class @@ -383,12 +356,8 @@ var TodoItemsContainer = { // set to cookied state $('.container.context').each(function(){ if($.cookie(TodoItemsContainer.buildCookieName(this))=="true"){ - var imgSrc = $(this).find('.container_toggle img').attr('src'); - if (imgSrc) { - $(this).find('.container_toggle img').attr('src', imgSrc.replace('collapse', 'expand')); - $(this).find('.toggle_target').hide(); - $(this).find('.toggle_target').parent().addClass("context_collapsed"); - } + $(this).find('.toggle_target').hide(); + $(this).find('.toggle_target').parent().addClass("context_collapsed"); } }); }, @@ -397,14 +366,6 @@ var TodoItemsContainer = { buildCookieName: function(containerElem) { var tracks_login = $.cookie('tracks_login'); return 'tracks_'+tracks_login+'_context_' + containerElem.id + '_collapsed'; - }, - showContainer: function(containerElem) { - var imgSrc = $(containerElem).find('.container_toggle img').attr('src'); - $(containerElem).find('.container_toggle img').attr('src', imgSrc.replace('expand', 'collapse')); - }, - hideContainer: function (containerElem) { - var imgSrc = $(containerElem).find('.container_toggle img').attr('src'); - $(containerElem).find('.container_toggle img').attr('src', imgSrc.replace('collapse', 'expand')); } } diff --git a/app/assets/stylesheets/tracks.css.scss b/app/assets/stylesheets/tracks.css.scss index f1e5b41f..bcd5d857 100644 --- a/app/assets/stylesheets/tracks.css.scss +++ b/app/assets/stylesheets/tracks.css.scss @@ -337,9 +337,12 @@ a.show_successors:hover, a.link_to_successors:hover {background-image: image-url } .container_toggle img { - height:14px; - width:14px; - border:0px; + height: 14px; + width: 14px; + border: 0px; + background: image-url('collapse_expand.png') no-repeat left top; + + .context_collapsed & { background-position: left bottom; } } h2 { diff --git a/app/views/contexts/_context.html.erb b/app/views/contexts/_context.html.erb index f6b940c9..6e7b6ee9 100644 --- a/app/views/contexts/_context.html.erb +++ b/app/views/contexts/_context.html.erb @@ -7,7 +7,7 @@ cache [context, @source_view, current_user.date.strftime("%Y%m%d")] do
">

<% if collapsible -%> - <%= image_tag("collapse.png") %> + <%= image_tag("blank.png", :alt => t('common.collapse_expand')) %> <% end -%> <% if source_view_is :context %> <%= context.name %> @@ -23,4 +23,4 @@ cache [context, @source_view, current_user.date.strftime("%Y%m%d")] do <%= render :partial => "todos/todo", :collection => @not_done, :locals => { :parent_container_type => "context" } %>

-<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/projects/_project.html.erb b/app/views/projects/_project.html.erb index 0f93bd8f..48ac6815 100644 --- a/app/views/projects/_project.html.erb +++ b/app/views/projects/_project.html.erb @@ -5,7 +5,7 @@ cache [project, current_user.date.strftime("%Y%m%d")] do %>

<% if collapsible -%> - <%= image_tag("collapse.png") %> + <%= image_tag("blank.png", :alt => t('common.collapse_expand')) %> <% end -%>
<%= project.name -%>

@@ -23,4 +23,4 @@ cache [project, current_user.date.strftime("%Y%m%d")] do %> <%= render :partial => "todos/todo", :collection => @not_done, :locals => { :parent_container_type => "project" } %>
-<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/todos/_completed.html.erb b/app/views/todos/_completed.html.erb index 354a03f6..e59107c4 100644 --- a/app/views/todos/_completed.html.erb +++ b/app/views/todos/_completed.html.erb @@ -6,7 +6,7 @@

<% if collapsible %> - <%= image_tag("collapse.png") %> + <%= image_tag("blank.png", :alt => t('common.collapse_expand')) %> <% end %> <%= t('todos.completed_actions') %> <%= raw suffix %>

@@ -18,4 +18,4 @@ <%= render :partial => "todos/todo", :collection => completed, :locals => { :parent_container_type => "completed", :suppress_context => suppress_context, :suppress_project => suppress_project } %> - \ No newline at end of file + diff --git a/app/views/todos/_deferred.html.erb b/app/views/todos/_deferred.html.erb index cab8f027..95c7ce02 100644 --- a/app/views/todos/_deferred.html.erb +++ b/app/views/todos/_deferred.html.erb @@ -1,7 +1,7 @@

<% if collapsible %> - <%= image_tag("collapse.png") %> + <%= image_tag("blank.png", :alt => t('common.collapse_expand')) %> <% end %> <%= t('todos.deferred_pending_actions') %> <%= raw(append_descriptor ? append_descriptor : '') %>

diff --git a/app/views/todos/_hidden.html.erb b/app/views/todos/_hidden.html.erb index 4f7e581f..a95b70d6 100644 --- a/app/views/todos/_hidden.html.erb +++ b/app/views/todos/_hidden.html.erb @@ -1,7 +1,7 @@ -
\ No newline at end of file + diff --git a/config/locales/en.yml b/config/locales/en.yml index 72b15e2b..ee968060 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -158,6 +158,7 @@ en: other: days deferred: deferred not_available_abbr: "n/a" + collapse_expand: Collapse/expand data: import_successful: Import was successful. import_errors: Some errors occurred during import