Commit 70d29ad8 authored by Clement Ho's avatar Clement Ho

Merge branch 'broken_iamge_when_doing_offline_update_check(help_page)' into 'master'

fix broken image when doing offline update check(help page)

Closes #25982

See merge request !8355
parents 106326a5 d5f34b37
...@@ -261,6 +261,9 @@ ...@@ -261,6 +261,9 @@
case 'projects:artifacts:browse': case 'projects:artifacts:browse':
new BuildArtifacts(); new BuildArtifacts();
break; break;
case 'help:index':
gl.VersionCheckImage.bindErrorEvent($('img.js-version-status-badge'));
break;
case 'search:show': case 'search:show':
new Search(); new Search();
break; break;
......
(() => {
class VersionCheckImage {
static bindErrorEvent(imageElement) {
imageElement.off('error').on('error', () => imageElement.hide());
}
}
window.gl = window.gl || {};
gl.VersionCheckImage = VersionCheckImage;
})();
module VersionCheckHelper module VersionCheckHelper
def version_status_badge def version_status_badge
if Rails.env.production? && current_application_settings.version_check_enabled if Rails.env.production? && current_application_settings.version_check_enabled
image_tag VersionCheck.new.url image_url = VersionCheck.new.url
image_tag image_url, class: 'js-version-status-badge'
end end
end end
end end
---
title: Hide version check image if there is no internet connection
merge_request: 8355
author: Ken Ding
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment