Commit c78393ec1714daaa01313793cdc3fa2e98378d7a
1 parent
8c918e58
Exists in
master
and in
4 other branches
Remove $.ready events
Showing
5 changed files
with
25 additions
and
35 deletions
Show diff stats
app/views/compare/_form.html.haml
| @@ -27,13 +27,11 @@ | @@ -27,13 +27,11 @@ | ||
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | :javascript | 29 | :javascript |
| 30 | - $(function() { | ||
| 31 | - var availableTags = #{@project.repository.ref_names.to_json}; | 30 | + var availableTags = #{@project.repository.ref_names.to_json}; |
| 32 | 31 | ||
| 33 | - $("#from, #to").autocomplete({ | ||
| 34 | - source: availableTags, | ||
| 35 | - minLength: 1 | ||
| 36 | - }); | ||
| 37 | - | ||
| 38 | - disableButtonIfEmptyField('#to', '.commits-compare-btn'); | 32 | + $("#from, #to").autocomplete({ |
| 33 | + source: availableTags, | ||
| 34 | + minLength: 1 | ||
| 39 | }); | 35 | }); |
| 36 | + | ||
| 37 | + disableButtonIfEmptyField('#to', '.commits-compare-btn'); |
app/views/layouts/_init_auto_complete.html.haml
| 1 | :javascript | 1 | :javascript |
| 2 | - $(function() { | ||
| 3 | - GitLab.GfmAutoComplete.dataSource = "#{autocomplete_sources_project_path(@project)}" | ||
| 4 | - GitLab.GfmAutoComplete.Emoji.assetBase = '#{image_path("emoji")}' | ||
| 5 | - GitLab.GfmAutoComplete.setup(); | ||
| 6 | - }); | 2 | + GitLab.GfmAutoComplete.dataSource = "#{autocomplete_sources_project_path(@project)}" |
| 3 | + GitLab.GfmAutoComplete.Emoji.assetBase = '#{image_path("emoji")}' | ||
| 4 | + GitLab.GfmAutoComplete.setup(); |
app/views/merge_requests/_form.html.haml
| @@ -62,20 +62,18 @@ | @@ -62,20 +62,18 @@ | ||
| 62 | Cancel | 62 | Cancel |
| 63 | 63 | ||
| 64 | :javascript | 64 | :javascript |
| 65 | - $(function(){ | ||
| 66 | - disableButtonIfEmptyField("#merge_request_title", ".btn-save"); | 65 | + disableButtonIfEmptyField("#merge_request_title", ".btn-save"); |
| 67 | 66 | ||
| 68 | - var source_branch = $("#merge_request_source_branch") | ||
| 69 | - , target_branch = $("#merge_request_target_branch"); | 67 | + var source_branch = $("#merge_request_source_branch") |
| 68 | + , target_branch = $("#merge_request_target_branch"); | ||
| 70 | 69 | ||
| 71 | - $.get("#{branch_from_project_merge_requests_path(@project)}", {ref: source_branch.val() }); | ||
| 72 | - $.get("#{branch_to_project_merge_requests_path(@project)}", {ref: target_branch.val() }); | 70 | + $.get("#{branch_from_project_merge_requests_path(@project)}", {ref: source_branch.val() }); |
| 71 | + $.get("#{branch_to_project_merge_requests_path(@project)}", {ref: target_branch.val() }); | ||
| 73 | 72 | ||
| 74 | - source_branch.live("change", function() { | ||
| 75 | - $.get("#{branch_from_project_merge_requests_path(@project)}", {ref: $(this).val() }); | ||
| 76 | - }); | 73 | + source_branch.live("change", function() { |
| 74 | + $.get("#{branch_from_project_merge_requests_path(@project)}", {ref: $(this).val() }); | ||
| 75 | + }); | ||
| 77 | 76 | ||
| 78 | - target_branch.live("change", function() { | ||
| 79 | - $.get("#{branch_to_project_merge_requests_path(@project)}", {ref: $(this).val() }); | ||
| 80 | - }); | 77 | + target_branch.live("change", function() { |
| 78 | + $.get("#{branch_to_project_merge_requests_path(@project)}", {ref: $(this).val() }); | ||
| 81 | }); | 79 | }); |
app/views/milestones/_form.html.haml
| @@ -40,10 +40,8 @@ | @@ -40,10 +40,8 @@ | ||
| 40 | 40 | ||
| 41 | 41 | ||
| 42 | :javascript | 42 | :javascript |
| 43 | - $(function() { | ||
| 44 | - disableButtonIfEmptyField("#milestone_title", ".btn-save"); | ||
| 45 | - $( ".datepicker" ).datepicker({ | ||
| 46 | - dateFormat: "yy-mm-dd", | ||
| 47 | - onSelect: function(dateText, inst) { $("#milestone_due_date").val(dateText) } | ||
| 48 | - }).datepicker("setDate", $.datepicker.parseDate('yy-mm-dd', $('#milestone_due_date').val())); | ||
| 49 | - }); | 43 | + disableButtonIfEmptyField("#milestone_title", ".btn-save"); |
| 44 | + $( ".datepicker" ).datepicker({ | ||
| 45 | + dateFormat: "yy-mm-dd", | ||
| 46 | + onSelect: function(dateText, inst) { $("#milestone_due_date").val(dateText) } | ||
| 47 | + }).datepicker("setDate", $.datepicker.parseDate('yy-mm-dd', $('#milestone_due_date').val())); |
app/views/search/_result.html.haml
| @@ -49,7 +49,5 @@ | @@ -49,7 +49,5 @@ | ||
| 49 | = paginate @blobs, theme: 'gitlab' | 49 | = paginate @blobs, theme: 'gitlab' |
| 50 | 50 | ||
| 51 | :javascript | 51 | :javascript |
| 52 | - $(function() { | ||
| 53 | - $(".search_results .term").highlight("#{escape_javascript(params[:search])}"); | ||
| 54 | - }) | 52 | + $(".search_results .term").highlight("#{escape_javascript(params[:search])}"); |
| 55 | 53 |