Js refactoring and ajax animation replaced
This commit is contained in:
parent
f1c534c68e
commit
7d56a51bdc
14 changed files with 41 additions and 54 deletions
|
@ -70,3 +70,7 @@ function showMenu() {
|
|||
function resetMenu() {
|
||||
$(this).removeClass("hover");
|
||||
}
|
||||
|
||||
function slugify(text) {
|
||||
return text.replace(/[^-a-zA-Z0-9]+/g, '_').toLowerCase();
|
||||
}
|
||||
|
|
|
@ -31,10 +31,12 @@ var MergeRequest = {
|
|||
$.ajax({
|
||||
type: "GET",
|
||||
url: $(".merge-diffs-tab").attr("data-url"),
|
||||
beforeSend: function(){ $('.status').addClass("loading")},
|
||||
complete: function(){
|
||||
MergeRequest.diffs_loaded = true;
|
||||
$(".merge_request_notes").hide();
|
||||
$(".dashboard-loader").hide()},
|
||||
$('.status').removeClass("loading");
|
||||
},
|
||||
dataType: "script"});
|
||||
}
|
||||
}
|
||||
|
|
14
app/assets/javascripts/projects.js
Normal file
14
app/assets/javascripts/projects.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
function Projects() {
|
||||
$("#project_name").live("change", function(){
|
||||
var slug = slugify($(this).val());
|
||||
$("#project_code").val(slug);
|
||||
$("#project_path").val(slug);
|
||||
});
|
||||
|
||||
$('.new_project, .edit_project').live('ajax:before', function() {
|
||||
$('.project_new_holder, .project_edit_holder').hide();
|
||||
$('.ajax_loader').show();
|
||||
});
|
||||
|
||||
$('form #project_default_branch').chosen();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue