From: Sascha Peilicke
---
src/webui/app/views/project/meta.html.erb | 2 +-
src/webui/app/views/shared/_editor.html.erb | 15 +++++++++++++++
src/webui/app/views/shared/_sourcediff.html.erb | 2 +-
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/src/webui/app/views/project/meta.html.erb b/src/webui/app/views/project/meta.html.erb
index 970905b..66707df 100644
--- a/src/webui/app/views/project/meta.html.erb
+++ b/src/webui/app/views/project/meta.html.erb
@@ -9,6 +9,6 @@
<% if @project.can_edit?(session[:login]) %>
<%= render :partial => "shared/editor", :locals => {:text => @meta, :mode => 'xml', :save => {:url => {:controller => 'project', :action => 'save_meta'}, :data => {:project => @project, :meta => '@@@'}}} %>
<% else %>
- <%= render :partial => "shared/editor", :locals => {:text => @meta, :mode => 'xml', :read_only => true} %>
+ <%= render :partial => "shared/editor", :locals => {:text => @meta, :mode => 'xml'} %>
<% end %>
</div>
diff --git a/src/webui/app/views/shared/_editor.html.erb b/src/webui/app/views/shared/_editor.html.erb
index 9c75022..2bdd9d7 100644
--- a/src/webui/app/views/shared/_editor.html.erb
+++ b/src/webui/app/views/shared/_editor.html.erb
@@ -1,8 +1,23 @@
+<% width ||= '100%' %>
+<% height ||= '600px' %>
<% save ||= false %>
<% read_only ||= false %>
<% content_for :content_for_head do %>
<%= stylesheet_link_tag 'cm2/codemirror', 'cm2/codemirror-ui', 'cm2/theme/default' %>
+ <style type="text/css">
+ .CodeMirror {
+ border-width: 0 0 0 0
+ }
+ .CodeMirror-scroll {
+ height: <%= height %>;
+ <% if height == 'auto' %>
+ overflow-y: hidden;
+ overflow-x: auto;
+ <% end %>
+ width: <%= width %>;
+ }
+ </style>
<% end %>
<%= javascript_include_tag 'cm2/codemirror-compressed', 'cm2/codemirror-ui' %>
diff --git a/src/webui/app/views/shared/_sourcediff.html.erb b/src/webui/app/views/shared/_sourcediff.html.erb
index f4156d7..6195b4e 100644
--- a/src/webui/app/views/shared/_sourcediff.html.erb
+++ b/src/webui/app/views/shared/_sourcediff.html.erb
@@ -62,7 +62,7 @@
<td align="center" valign="bottom"><%= link_to('^', :anchor => "diff_view_#{file_id}") %></td>
<td colspan="2">
<%# TODO: Fix editor size adjustment %>
- <%= render :partial => "shared/editor", :locals => {:text => file_diff_text, :mode => 'diff', :read_only => true} %>
+ <%= render :partial => "shared/editor", :locals => {:text => file_diff_text, :mode => 'diff', :read_only => true, :height => 'auto', :width => '750px'} %>
</td>
</tr>
<% end %>
--
1.7.7
--
To unsubscribe, e-mail: obs-commits+unsubscribe@opensuse.org
To contact the owner, e-mail: obs-commits+owner@opensuse.org