diff --git a/app/assets/stylesheets/design/custom.scss b/app/assets/stylesheets/design/custom.scss index 2ae68d0c2..4ee8835b2 100644 --- a/app/assets/stylesheets/design/custom.scss +++ b/app/assets/stylesheets/design/custom.scss @@ -1708,3 +1708,12 @@ table#myTable thead tr.search th form.button_to div input { margin-top: 2px; } +.file-editor { + margin-bottom: 10px; + margin-top: 10px; + max-width: 860px; +} + +.CodeMirror { + border: 1px solid #DDDDDD; +} \ No newline at end of file diff --git a/app/views/projects/git/blobs/_editor.html.haml b/app/views/projects/git/blobs/_editor.html.haml index 1298ff0c0..3cd15157b 100644 --- a/app/views/projects/git/blobs/_editor.html.haml +++ b/app/views/projects/git/blobs/_editor.html.haml @@ -5,7 +5,7 @@ .both = form_tag edit_blob_path(@project, @treeish, @path), :name => 'blob-editor', :method => :put do - .file= text_area_tag :content, @blob.data, :id => 'code' + .file-editor= text_area_tag :content, @blob.data, :id => 'code' .both = t("layout.enter_commit_message") @@ -23,4 +23,12 @@ lineNumbers: true, mode: '#{@blob.raw_mime_type.content_type}' }); - }); + $(".CodeMirror").resizable({ + stop: function() { editor.refresh(); }, + resize: function() { + $(".CodeMirror-scroll").height($(this).height()); + $(".CodeMirror-scroll").width($(this).width()); + editor.refresh(); + } + }); + }); \ No newline at end of file diff --git a/vendor/assets/stylesheets/codemirror.css b/vendor/assets/stylesheets/codemirror.css index 89d08ffbe..d1f4d6c68 100644 --- a/vendor/assets/stylesheets/codemirror.css +++ b/vendor/assets/stylesheets/codemirror.css @@ -5,7 +5,6 @@ .CodeMirror-scroll { overflow: auto; - height: 300px; /* This is needed to prevent an IE[67] bug where the scrolled content is visible outside of the scrolling box. */ position: relative;