Commit c78393ec authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Remove $.ready events

parent 8c918e58
...@@ -27,13 +27,11 @@ ...@@ -27,13 +27,11 @@
:javascript :javascript
$(function() { var availableTags = #{@project.repository.ref_names.to_json};
var availableTags = #{@project.repository.ref_names.to_json};
$("#from, #to").autocomplete({ $("#from, #to").autocomplete({
source: availableTags, source: availableTags,
minLength: 1 minLength: 1
});
disableButtonIfEmptyField('#to', '.commits-compare-btn');
}); });
disableButtonIfEmptyField('#to', '.commits-compare-btn');
:javascript :javascript
$(function() { GitLab.GfmAutoComplete.dataSource = "#{autocomplete_sources_project_path(@project)}"
GitLab.GfmAutoComplete.dataSource = "#{autocomplete_sources_project_path(@project)}" GitLab.GfmAutoComplete.Emoji.assetBase = '#{image_path("emoji")}'
GitLab.GfmAutoComplete.Emoji.assetBase = '#{image_path("emoji")}' GitLab.GfmAutoComplete.setup();
GitLab.GfmAutoComplete.setup();
});
...@@ -62,20 +62,18 @@ ...@@ -62,20 +62,18 @@
Cancel Cancel
:javascript :javascript
$(function(){ disableButtonIfEmptyField("#merge_request_title", ".btn-save");
disableButtonIfEmptyField("#merge_request_title", ".btn-save");
var source_branch = $("#merge_request_source_branch") var source_branch = $("#merge_request_source_branch")
, target_branch = $("#merge_request_target_branch"); , target_branch = $("#merge_request_target_branch");
$.get("#{branch_from_project_merge_requests_path(@project)}", {ref: source_branch.val() }); $.get("#{branch_from_project_merge_requests_path(@project)}", {ref: source_branch.val() });
$.get("#{branch_to_project_merge_requests_path(@project)}", {ref: target_branch.val() }); $.get("#{branch_to_project_merge_requests_path(@project)}", {ref: target_branch.val() });
source_branch.live("change", function() { source_branch.live("change", function() {
$.get("#{branch_from_project_merge_requests_path(@project)}", {ref: $(this).val() }); $.get("#{branch_from_project_merge_requests_path(@project)}", {ref: $(this).val() });
}); });
target_branch.live("change", function() { target_branch.live("change", function() {
$.get("#{branch_to_project_merge_requests_path(@project)}", {ref: $(this).val() }); $.get("#{branch_to_project_merge_requests_path(@project)}", {ref: $(this).val() });
});
}); });
...@@ -40,10 +40,8 @@ ...@@ -40,10 +40,8 @@
:javascript :javascript
$(function() { disableButtonIfEmptyField("#milestone_title", ".btn-save");
disableButtonIfEmptyField("#milestone_title", ".btn-save"); $( ".datepicker" ).datepicker({
$( ".datepicker" ).datepicker({ dateFormat: "yy-mm-dd",
dateFormat: "yy-mm-dd", onSelect: function(dateText, inst) { $("#milestone_due_date").val(dateText) }
onSelect: function(dateText, inst) { $("#milestone_due_date").val(dateText) } }).datepicker("setDate", $.datepicker.parseDate('yy-mm-dd', $('#milestone_due_date').val()));
}).datepicker("setDate", $.datepicker.parseDate('yy-mm-dd', $('#milestone_due_date').val()));
});
...@@ -49,7 +49,5 @@ ...@@ -49,7 +49,5 @@
= paginate @blobs, theme: 'gitlab' = paginate @blobs, theme: 'gitlab'
:javascript :javascript
$(function() { $(".search_results .term").highlight("#{escape_javascript(params[:search])}");
$(".search_results .term").highlight("#{escape_javascript(params[:search])}");
})
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment