Merge pull request #855 from warpc/765-form_resize
[refs #765] add CodeMirror resizable ability for git edit fields
This commit is contained in:
commit
3e0efd8973
|
@ -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;
|
||||
}
|
|
@ -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();
|
||||
}
|
||||
});
|
||||
});
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue