[refs #765] add CodeMirror resizable ability

This commit is contained in:
Alexander Machehin 2013-01-25 14:11:15 +06:00
parent e65a00e622
commit 421fa2880c
3 changed files with 19 additions and 3 deletions

View File

@ -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;
}

View File

@ -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();
}
});
});

View File

@ -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;