Commit 249cb19d96cff52f70f930fbf13ee23ae5d66d3e
1 parent
7cce2b15
Exists in
master
and in
4 other branches
Fix project update. Make slim form only for reversed comments
Showing
5 changed files
with
15 additions
and
20 deletions
Show diff stats
app/assets/javascripts/notes.js
@@ -34,16 +34,21 @@ var NoteList = { | @@ -34,16 +34,21 @@ var NoteList = { | ||
34 | 34 | ||
35 | disableButtonIfEmptyField(".note-text", ".submit_note"); | 35 | disableButtonIfEmptyField(".note-text", ".submit_note"); |
36 | 36 | ||
37 | - $(".note-text").on("focus", function(){ | ||
38 | - $(this).css("height", "80px"); | ||
39 | - $('.note_advanced_opts').show(); | ||
40 | - }); | ||
41 | - | ||
42 | $("#note_attachment").change(function(e){ | 37 | $("#note_attachment").change(function(e){ |
43 | var val = $('.input-file').val(); | 38 | var val = $('.input-file').val(); |
44 | var filename = val.replace(/^.*[\\\/]/, ''); | 39 | var filename = val.replace(/^.*[\\\/]/, ''); |
45 | $(".file_name").text(filename); | 40 | $(".file_name").text(filename); |
46 | }); | 41 | }); |
42 | + | ||
43 | + if(this.reversed) { | ||
44 | + var textarea = $(".note-text"); | ||
45 | + $('.note_advanced_opts').hide(); | ||
46 | + textarea.css("height", "40px"); | ||
47 | + textarea.on("focus", function(){ | ||
48 | + $(this).css("height", "80px"); | ||
49 | + $('.note_advanced_opts').show(); | ||
50 | + }); | ||
51 | + } | ||
47 | }, | 52 | }, |
48 | 53 | ||
49 | 54 |
app/assets/stylesheets/sections/notes.scss
@@ -10,13 +10,6 @@ | @@ -10,13 +10,6 @@ | ||
10 | padding:0px; | 10 | padding:0px; |
11 | } | 11 | } |
12 | 12 | ||
13 | -#new-notes-list:not(.reversed) { | ||
14 | - border-top:1px solid #aaa; | ||
15 | -} | ||
16 | -#new-notes-list.reversed { | ||
17 | - border-bottom:1px solid #ccc; | ||
18 | -} | ||
19 | - | ||
20 | .issue_notes, | 13 | .issue_notes, |
21 | .wiki_notes { | 14 | .wiki_notes { |
22 | .note_content { | 15 | .note_content { |
@@ -33,9 +26,6 @@ | @@ -33,9 +26,6 @@ | ||
33 | } | 26 | } |
34 | 27 | ||
35 | #new_note { | 28 | #new_note { |
36 | - .note-text { | ||
37 | - height:40px; | ||
38 | - } | ||
39 | .attach_holder { | 29 | .attach_holder { |
40 | display:none; | 30 | display:none; |
41 | } | 31 | } |
app/views/notes/_common_form.html.haml
@@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
14 | .right Comments are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. | 14 | .right Comments are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. |
15 | .clearfix | 15 | .clearfix |
16 | 16 | ||
17 | - .row.note_advanced_opts.hide | 17 | + .row.note_advanced_opts |
18 | .span3 | 18 | .span3 |
19 | = f.submit 'Add Comment', class: "btn success submit_note grouped", id: "submit_note" | 19 | = f.submit 'Add Comment', class: "btn success submit_note grouped", id: "submit_note" |
20 | = link_to 'Preview', preview_project_notes_path(@project), class: 'btn grouped', id: 'preview-link' | 20 | = link_to 'Preview', preview_project_notes_path(@project), class: 'btn grouped', id: 'preview-link' |
app/views/notes/_reversed_notes_with_form.html.haml
@@ -8,4 +8,4 @@ | @@ -8,4 +8,4 @@ | ||
8 | :javascript | 8 | :javascript |
9 | $(function(){ | 9 | $(function(){ |
10 | NoteList.init("#{tid}", "#{tt}", "#{project_notes_path(@project)}"); | 10 | NoteList.init("#{tid}", "#{tt}", "#{project_notes_path(@project)}"); |
11 | - }); | ||
12 | \ No newline at end of file | 11 | \ No newline at end of file |
12 | + }); |
app/views/projects/edit.html.haml
@@ -3,10 +3,10 @@ | @@ -3,10 +3,10 @@ | ||
3 | %h3.page_title Edit Project | 3 | %h3.page_title Edit Project |
4 | %hr | 4 | %hr |
5 | = render "projects/form" | 5 | = render "projects/form" |
6 | -%div.ajax_loader.hide | 6 | +%div.save-project-loader.hide |
7 | %center | 7 | %center |
8 | - %div.padded= image_tag "ajax_loader.gif" | ||
9 | - %h3.prepend-top Saving project & repository. Please wait... | 8 | + = image_tag "ajax_loader.gif" |
9 | + %h3 Saving project. Please wait a few minutes | ||
10 | 10 | ||
11 | :javascript | 11 | :javascript |
12 | $(function(){ new Projects(); }); | 12 | $(function(){ new Projects(); }); |