Merge branch 'bugfix/2393_warning_message_when_leaving_site_without_saving' into dev

pull/1037/merge
Hagen Schink 11 years ago
commit d915b4638c
  1. 7
      app/helpers/application_helper.rb
  2. 2
      features/work_packages/attachments.feature

@ -993,7 +993,12 @@ module ApplicationHelper
I18n.locale = "#{I18n.locale}"; I18n.locale = "#{I18n.locale}";
}) })
unless User.current.pref.warn_on_leaving_unsaved == '0' unless User.current.pref.warn_on_leaving_unsaved == '0'
tags += javascript_tag("jQuery(function(){ new WarnLeavingUnsaved('#{escape_javascript( l(:text_warn_on_leaving_unsaved) )}'); });") tags += javascript_tag("jQuery(document).ready(function(){
new WarnLeavingUnsaved('#{escape_javascript( l(:text_warn_on_leaving_unsaved) )}');
jQuery(document).ajaxComplete(function(){
new WarnLeavingUnsaved('#{escape_javascript( l(:text_warn_on_leaving_unsaved) )}')
});
})")
end end
if User.current.impaired? and accessibility_js_enabled? if User.current.impaired? and accessibility_js_enabled?

@ -43,6 +43,8 @@ Feature: Attachments on work packages
| edit_work_packages | | edit_work_packages |
And there is 1 user with the following: And there is 1 user with the following:
| login | bob| | login | bob|
And the user "bob" has the following preferences
| warn_on_leaving_unsaved | 0 |
And the user "bob" is a "member" in the project "parent" And the user "bob" is a "member" in the project "parent"
And there are the following issue status: And there are the following issue status:
| name | is_closed | is_default | | name | is_closed | is_default |

Loading…
Cancel
Save