Commit 5866b17204bc07addf369d038bf04f345fa4891a

Authored by Nathan Broadbent
1 parent ceb75dd4
Exists in master and in 1 other branch production

Emulate support for 'word-wrap: break-word' in firefox

app/helpers/errs_helper.rb
... ... @@ -6,5 +6,11 @@ module ErrsHelper
6 6 def err_confirm
7 7 Errbit::Config.confirm_resolve_err === false ? nil : 'Seriously?'
8 8 end
  9 +
  10 + def trucated_err_message(problem)
  11 + msg = truncate(problem.message, :length => 300)
  12 + # Insert invisible unicode characters so that firefox can emulate 'word-wrap: break-word' CSS
  13 + msg.scan(/.{5}/).join("​").html_safe
  14 + end
9 15 end
10 16  
... ...
app/views/errs/_table.html.haml
... ... @@ -21,7 +21,7 @@
21 21 - else
22 22 %span.environment= link_to problem.environment, app_path(problem.app, environment: problem.environment)
23 23 %td.message
24   - = link_to problem.message, app_err_path(problem.app, problem)
  24 + = link_to trucated_err_message(problem), app_err_path(problem.app, problem)
25 25 %em= problem.where
26 26 %td.latest #{time_ago_in_words(last_notice_at problem)} ago
27 27 %td.deploy= problem.last_deploy_at ? problem.last_deploy_at.to_s(:micro) : 'n/a'
... ... @@ -39,3 +39,4 @@
39 39 %li= submit_tag 'Resolve', :id => 'resolve_errs', :class => 'button', 'data-action' => resolve_several_errs_path
40 40 %li= submit_tag 'Unresolve', :id => 'unresolve_errs', :class => 'button', 'data-action' => unresolve_several_errs_path
41 41 %li= submit_tag 'Delete', :id => 'delete_errs', :class => 'button', 'data-action' => destroy_several_errs_path
  42 +
... ...