From fcee6e7f99122e88bb4bef7cb6c1b31fc42eac6b Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sun, 28 Jun 2015 02:23:35 +0200 Subject: [PATCH] Small bugfixes. --- .../javascripts/app/controllers/translation.js.coffee | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/app/controllers/translation.js.coffee b/app/assets/javascripts/app/controllers/translation.js.coffee index 626abf5ad..eb978f243 100644 --- a/app/assets/javascripts/app/controllers/translation.js.coffee +++ b/app/assets/javascripts/app/controllers/translation.js.coffee @@ -46,6 +46,9 @@ class Index extends App.ControllerContent if @translationToDo.changes() || @translationList.changes() App.Delay.set(rerender, 400) + hideAction: => + @el.closest('.content').find('.js-changes').addClass('hidden') + pushChanges: => locale = @$('[name="locale"]').val() @@ -89,6 +92,7 @@ class Index extends App.ControllerContent data: JSON.stringify(locale: locale) processData: false success: (data, status, xhr) => + @hideAction() App.Event.trigger('i18n:translation_todo_reload') App.Event.trigger('i18n:translation_list_reload') @modal.hide() @@ -115,6 +119,7 @@ class Index extends App.ControllerContent data: JSON.stringify(locale: locale) processData: false success: (data, status, xhr) => + @hideAction() App.Event.trigger('i18n:translation_todo_reload') App.Event.trigger('i18n:translation_list_reload') @modal.hide() @@ -266,13 +271,12 @@ class TranslationList extends App.Controller strings: @strings ) ui = @ - changesAvailable = false + @changesAvailable = false @$('.js-Item').each( (e) -> id = $(this).data('id') ui.updateRow(id) - changesAvailable = true ) - if changesAvailable + if @changesAvailable @showAction() showAction: => @@ -371,6 +375,7 @@ class TranslationList extends App.Controller initial = field.data('initial') reset = field.closest('tr').find('.js-Reset') if current isnt initial + @changesAvailable = true reset.show() reset.closest('tr').addClass('warning') else