From 92d7a9f3fde4deac606025d16f2587b918158e15 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 12 Dec 2013 08:55:26 +0000 Subject: [PATCH 1/1] Make rich text edit controls use as much space as possible Use CSS3 calculations to set the width of a rich text edit control to the maximum possible while still allowing space for the help. Also set the subject/title fields to the same width. Fixes #657 --- app/assets/stylesheets/common.css.scss | 18 ++++++++++++++++++ app/views/diary_entry/edit.html.erb | 2 +- app/views/message/new.html.erb | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/common.css.scss b/app/assets/stylesheets/common.css.scss index 8b57a12fe..b6745f809 100644 --- a/app/assets/stylesheets/common.css.scss +++ b/app/assets/stylesheets/common.css.scss @@ -2110,14 +2110,32 @@ a.button { /* Rules for rich text editors */ +input.richtext_title[type="text"] { + width: 50%; + width: -moz-calc(100% - 235px); + width: -webkit-calc(100% - 235px); + width: calc(100% - 235px); + + @media only screen and (max-width:768px) { + width: 100%; + } +} + .richtext_container { margin-bottom: $lineheight; .richtext_content { width: 50%; + width: -moz-calc(100% - 235px); + width: -webkit-calc(100% - 235px); + width: calc(100% - 235px); display: inline-block; vertical-align: top; + @media only screen and (max-width:768px) { + width: 100%; + } + .richtext_preview { display: inline-block; padding: $lineheight; diff --git a/app/views/diary_entry/edit.html.erb b/app/views/diary_entry/edit.html.erb index af23262d5..c49573bec 100644 --- a/app/views/diary_entry/edit.html.erb +++ b/app/views/diary_entry/edit.html.erb @@ -13,7 +13,7 @@
- <%= f.text_field :title %> + <%= f.text_field :title, :class => "richtext_title" %>
diff --git a/app/views/message/new.html.erb b/app/views/message/new.html.erb index ac8fe7f49..b8af5aac9 100644 --- a/app/views/message/new.html.erb +++ b/app/views/message/new.html.erb @@ -8,7 +8,7 @@
- <%= f.text_field :title, :size => 60, :value => @subject %> + <%= f.text_field :title, :size => 60, :value => @subject, :class => "richtext_title" %>
-- 2.43.2