Commit 65e88f1e authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fixed few tests and improved css style

parent 8ecf7d32
......@@ -6,6 +6,7 @@ class @EditBlob
ace_mode = mode
editor = ace.edit("editor")
editor.focus()
@editor = editor
if ace_mode
editor.getSession().setMode "ace/mode/" + ace_mode
......@@ -38,3 +39,6 @@ class @EditBlob
currentPane.fadeIn 200
editor.focus()
return
editor: ->
return @editor
......@@ -6,6 +6,7 @@ class @NewBlob
ace_mode = mode
editor = ace.edit("editor")
editor.focus()
@editor = editor
if ace_mode
editor.getSession().setMode "ace/mode/" + ace_mode
......@@ -15,3 +16,6 @@ class @NewBlob
$("#file-content").val editor.getValue()
$(".file-editor form").submit()
return
editor: ->
return @editor
......@@ -35,15 +35,15 @@
.file-title {
@extend .monospace;
font-size: 14px;
padding: 5px;
}
.editor-ref {
background: #fafafa;
padding: 18px 15px;
padding-left: 25px;
background: #f5f5f5;
padding: 11px 15px;
border-right: 1px solid #CCC;
display: inline-block;
margin: -10px -15px;
margin: -5px -5px;
margin-right: 10px;
}
......
......@@ -21,4 +21,4 @@
cancel_path: @after_edit_path
:javascript
new EditBlob(gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}", "#{@blob.language.try(:ace_mode)}")
blob = new EditBlob(gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}", "#{@blob.language.try(:ace_mode)}")
......@@ -9,4 +9,4 @@
cancel_path: project_tree_path(@project, @id)
:javascript
new NewBlob(gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}", null)
blob = new NewBlob(gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}", null)
......@@ -58,7 +58,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
step 'I can edit code' do
set_new_content
evaluate_script('editor.getValue()').should == new_gitignore_content
evaluate_script('blob.editor.getValue()').should == new_gitignore_content
end
step 'I edit code' do
......@@ -103,7 +103,6 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
step 'I can see new file page' do
page.should have_content "New file"
page.should have_content "File name"
page.should have_content "Commit message"
end
......@@ -170,7 +169,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
private
def set_new_content
execute_script("editor.setValue('#{new_gitignore_content}')")
execute_script("blob.editor.setValue('#{new_gitignore_content}')")
end
# Content of the gitignore file on the seed repository.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment