Fix project update. Make slim form only for reversed comments

This commit is contained in:
Dmitriy Zaporozhets 2012-09-18 08:54:17 +03:00
parent 7cce2b1506
commit 249cb19d96
5 changed files with 15 additions and 20 deletions

View file

@ -34,16 +34,21 @@ var NoteList = {
disableButtonIfEmptyField(".note-text", ".submit_note"); disableButtonIfEmptyField(".note-text", ".submit_note");
$(".note-text").on("focus", function(){
$(this).css("height", "80px");
$('.note_advanced_opts').show();
});
$("#note_attachment").change(function(e){ $("#note_attachment").change(function(e){
var val = $('.input-file').val(); var val = $('.input-file').val();
var filename = val.replace(/^.*[\\\/]/, ''); var filename = val.replace(/^.*[\\\/]/, '');
$(".file_name").text(filename); $(".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();
});
}
}, },

View file

@ -10,13 +10,6 @@
padding:0px; padding:0px;
} }
#new-notes-list:not(.reversed) {
border-top:1px solid #aaa;
}
#new-notes-list.reversed {
border-bottom:1px solid #ccc;
}
.issue_notes, .issue_notes,
.wiki_notes { .wiki_notes {
.note_content { .note_content {
@ -33,9 +26,6 @@
} }
#new_note { #new_note {
.note-text {
height:40px;
}
.attach_holder { .attach_holder {
display:none; display:none;
} }

View file

@ -14,7 +14,7 @@
.right Comments are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. .right Comments are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}.
.clearfix .clearfix
.row.note_advanced_opts.hide .row.note_advanced_opts
.span3 .span3
= f.submit 'Add Comment', class: "btn success submit_note grouped", id: "submit_note" = 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' = link_to 'Preview', preview_project_notes_path(@project), class: 'btn grouped', id: 'preview-link'

View file

@ -8,4 +8,4 @@
:javascript :javascript
$(function(){ $(function(){
NoteList.init("#{tid}", "#{tt}", "#{project_notes_path(@project)}"); NoteList.init("#{tid}", "#{tt}", "#{project_notes_path(@project)}");
}); });

View file

@ -3,10 +3,10 @@
%h3.page_title Edit Project %h3.page_title Edit Project
%hr %hr
= render "projects/form" = render "projects/form"
%div.ajax_loader.hide %div.save-project-loader.hide
%center %center
%div.padded= image_tag "ajax_loader.gif" = image_tag "ajax_loader.gif"
%h3.prepend-top Saving project & repository. Please wait... %h3 Saving project. Please wait a few minutes
:javascript :javascript
$(function(){ new Projects(); }); $(function(){ new Projects(); });