2017-05-30 21:11:28 +08:00
|
|
|
(function() {
|
|
|
|
'use strict';
|
|
|
|
|
2017-06-05 20:09:04 +08:00
|
|
|
$('.delete-repo-option').initializeModal('#delete-repo-modal');
|
|
|
|
$('.rename-repo-option').initializeModal('#rename-repo-modal');
|
2017-06-08 00:43:48 +08:00
|
|
|
$('.copy-repo-option').initializeModal('#copy-repo-modal');
|
2017-06-06 21:50:43 +08:00
|
|
|
$('.create-repository').initializeModal('#create-repo-modal');
|
2017-06-08 17:44:24 +08:00
|
|
|
|
|
|
|
loadRepositoryTab();
|
|
|
|
|
2017-05-30 21:11:28 +08:00
|
|
|
})();
|
2017-06-08 17:44:24 +08:00
|
|
|
|
|
|
|
function loadRepositoryTab() {
|
|
|
|
$('#repository-tabs a').on("click", function(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
var pane = $(this);
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
url: $(this).attr("data-url"),
|
|
|
|
type: "GET",
|
|
|
|
dataType: "json",
|
|
|
|
success: function (data) {
|
|
|
|
var tabBody = $(pane.context.hash).find(".tab-content-body");
|
|
|
|
tabBody.html(data.html);
|
|
|
|
pane.tab('show');
|
|
|
|
},
|
|
|
|
error: function (error) {
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
// load first tab content
|
|
|
|
$('#repository-tabs a:first').click();
|
|
|
|
|
|
|
|
// clean tab content
|
|
|
|
$('a[data-toggle="tab"]').on('hide.bs.tab', function (e) {
|
|
|
|
$(".tab-content-body").html("");
|
|
|
|
})
|
|
|
|
}
|