Skip to content

Commit b18be27

Browse files
author
root
committed
Fix initialization of Git URL boxes in Project overview
1 parent 7c80393 commit b18be27

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Diff for: app/views/common/_git_urls.html.haml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
#git_url_box= l(:label_repository_access_not_configured)
2020

2121
:javascript
22-
$(document).ready(function() { setGitUrls('.git_url'); });
22+
$(document).ready(function() { setFirstGitUrl('.git_url_list'); setGitUrls('.git_url'); });

Diff for: assets/javascripts/application.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,19 @@ function updateUrl(element) {
5050

5151
function setGitUrls(elements) {
5252
$(elements).each(function(index, element){
53-
if (index == 0){
54-
updateUrl(element);
55-
};
5653
$(element).on('click', function(){
5754
updateUrl($(this));
5855
});
5956
});
6057
}
6158

59+
function setFirstGitUrl(elements) {
60+
$(elements).each(function(index, element){
61+
var first_url = $(element).children().first();
62+
updateUrl(first_url);
63+
});
64+
}
65+
6266
// GIT INSTRUCTIONS
6367
function updateInstructionUrl(element) {
6468
var url = $(element).data('url');

0 commit comments

Comments
 (0)