Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
d5f34b37
Commit
d5f34b37
authored
Jan 20, 2017
by
Ken Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hide the version check image if internet connection is broken
parent
8c0e358a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
1 deletion
+19
-1
app/assets/javascripts/dispatcher.js.es6
app/assets/javascripts/dispatcher.js.es6
+3
-0
app/assets/javascripts/version_check_image.js.es6
app/assets/javascripts/version_check_image.js.es6
+10
-0
app/helpers/version_check_helper.rb
app/helpers/version_check_helper.rb
+2
-1
changelogs/unreleased/broken_iamge_when_doing_offline_update_check-help_page-.yml
...oken_iamge_when_doing_offline_update_check-help_page-.yml
+4
-0
No files found.
app/assets/javascripts/dispatcher.js.es6
View file @
d5f34b37
...
...
@@ -261,6 +261,9 @@
case 'projects:artifacts:browse':
new BuildArtifacts();
break;
case 'help:index':
gl.VersionCheckImage.bindErrorEvent($('img.js-version-status-badge'));
break;
case 'search:show':
new Search();
break;
...
...
app/assets/javascripts/version_check_image.js.es6
0 → 100644
View file @
d5f34b37
(() => {
class VersionCheckImage {
static bindErrorEvent(imageElement) {
imageElement.off('error').on('error', () => imageElement.hide());
}
}
window.gl = window.gl || {};
gl.VersionCheckImage = VersionCheckImage;
})();
app/helpers/version_check_helper.rb
View file @
d5f34b37
module
VersionCheckHelper
def
version_status_badge
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
changelogs/unreleased/broken_iamge_when_doing_offline_update_check-help_page-.yml
0 → 100644
View file @
d5f34b37
---
title
:
Hide version check image if there is no internet connection
merge_request
:
8355
author
:
Ken Ding
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment