From 249cb19d96cff52f70f930fbf13ee23ae5d66d3e Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 18 Sep 2012 08:54:17 +0300 Subject: [PATCH] Fix project update. Make slim form only for reversed comments --- app/assets/javascripts/notes.js | 15 ++++++++++----- app/assets/stylesheets/sections/notes.scss | 10 ---------- app/views/notes/_common_form.html.haml | 2 +- .../notes/_reversed_notes_with_form.html.haml | 2 +- app/views/projects/edit.html.haml | 6 +++--- 5 files changed, 15 insertions(+), 20 deletions(-) diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index 81bb1d6d..4a55b41b 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -34,16 +34,21 @@ var NoteList = { disableButtonIfEmptyField(".note-text", ".submit_note"); - $(".note-text").on("focus", function(){ - $(this).css("height", "80px"); - $('.note_advanced_opts').show(); - }); - $("#note_attachment").change(function(e){ var val = $('.input-file').val(); var filename = val.replace(/^.*[\\\/]/, ''); $(".file_name").text(filename); }); + + if(this.reversed) { + var textarea = $(".note-text"); + $('.note_advanced_opts').hide(); + textarea.css("height", "40px"); + textarea.on("focus", function(){ + $(this).css("height", "80px"); + $('.note_advanced_opts').show(); + }); + } }, diff --git a/app/assets/stylesheets/sections/notes.scss b/app/assets/stylesheets/sections/notes.scss index 148807d6..5fc6c96e 100644 --- a/app/assets/stylesheets/sections/notes.scss +++ b/app/assets/stylesheets/sections/notes.scss @@ -10,13 +10,6 @@ padding:0px; } -#new-notes-list:not(.reversed) { - border-top:1px solid #aaa; -} -#new-notes-list.reversed { - border-bottom:1px solid #ccc; -} - .issue_notes, .wiki_notes { .note_content { @@ -33,9 +26,6 @@ } #new_note { - .note-text { - height:40px; - } .attach_holder { display:none; } diff --git a/app/views/notes/_common_form.html.haml b/app/views/notes/_common_form.html.haml index 6d559cfc..fc6e3c7e 100644 --- a/app/views/notes/_common_form.html.haml +++ b/app/views/notes/_common_form.html.haml @@ -14,7 +14,7 @@ .right Comments are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. .clearfix - .row.note_advanced_opts.hide + .row.note_advanced_opts .span3 = f.submit 'Add Comment', class: "btn success submit_note grouped", id: "submit_note" = link_to 'Preview', preview_project_notes_path(@project), class: 'btn grouped', id: 'preview-link' diff --git a/app/views/notes/_reversed_notes_with_form.html.haml b/app/views/notes/_reversed_notes_with_form.html.haml index 05f01847..24d59924 100644 --- a/app/views/notes/_reversed_notes_with_form.html.haml +++ b/app/views/notes/_reversed_notes_with_form.html.haml @@ -8,4 +8,4 @@ :javascript $(function(){ NoteList.init("#{tid}", "#{tt}", "#{project_notes_path(@project)}"); - }); \ No newline at end of file + }); diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index 987d43ec..fdd537da 100644 --- a/app/views/projects/edit.html.haml +++ b/app/views/projects/edit.html.haml @@ -3,10 +3,10 @@ %h3.page_title Edit Project %hr = render "projects/form" -%div.ajax_loader.hide +%div.save-project-loader.hide %center - %div.padded= image_tag "ajax_loader.gif" - %h3.prepend-top Saving project & repository. Please wait... + = image_tag "ajax_loader.gif" + %h3 Saving project. Please wait a few minutes :javascript $(function(){ new Projects(); });