Skip to content

Commit 537abf3

Browse files
author
root
committed
Move JS functions to JS file
1 parent f0d34e8 commit 537abf3

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

Diff for: app/views/settings/_redmine_git_hosting.html.haml

+1-15
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,4 @@
1616
= render_tabs gitolite_plugin_settings_tabs
1717

1818
:javascript
19-
$(document).ready(function() {
20-
groups = $('[id^=tab-gitolite_]');
21-
22-
$.each(groups, function(key, elem) {
23-
$(elem).on('click', function(){
24-
if ("replaceState" in window.history) {
25-
window.history.replaceState(null, document.title, 'redmine_git_hosting?tab=' + $(this).attr('id').replace('tab-', ''));
26-
}
27-
});
28-
});
29-
30-
$('.bootstrap-switch').each(function(index, element) {
31-
installBootstrapSwitch(element);
32-
});
33-
});
19+
$(document).ready(function() { setSettingsActiveTab(); setBootstrapSwitch(); });

Diff for: assets/javascripts/application.js

+12
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,15 @@ function setRepositoryActiveTab(current_tab) {
8282
}
8383
});
8484
}
85+
86+
function setSettingsActiveTab() {
87+
groups = $('[id^=tab-gitolite_]');
88+
89+
$.each(groups, function(key, elem) {
90+
$(elem).on('click', function(){
91+
if ("replaceState" in window.history) {
92+
window.history.replaceState(null, document.title, 'redmine_git_hosting?tab=' + $(this).attr('id').replace('tab-', ''));
93+
}
94+
});
95+
});
96+
}

0 commit comments

Comments
 (0)