gitlab-org--gitlab-foss/app/views/layouts/errors.html.haml
Heinrich Lee Yu 0284917c70 Remove inline JS in links
Changes these to use unobtrusive JS
2019-08-21 05:43:04 +08:00

23 lines
712 B
Text

!!! 5
%html{ lang: "en" }
%head
%meta{ :content => "width=device-width, initial-scale=1, maximum-scale=1", :name => "viewport" }
%title= yield(:title)
%style
= Rails.application.assets_manifest.find_sources('errors.css').first.to_s.html_safe
%body
.page-container
= yield
= javascript_tag nonce: true do
:plain
(function(){
var goBackElement = document.querySelector('.js-go-back');
if (goBackElement && history.length > 1) {
goBackElement.removeAttribute('hidden');
goBackElement.querySelector('button').addEventListener('click', function() {
history.back();
});
}
}());