changeset 5654:63016f784d88

merge main
author Radomir Dopieralski <moindev@sheep.art.pl>
date Mon, 05 Apr 2010 23:37:52 +0200
parents b82318102f22 (current diff) 5b04b7edee94 (diff)
children 115278a9a95f
files
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/PageGraphicalEditor.py	Mon Apr 05 23:37:24 2010 +0200
+++ b/MoinMoin/PageGraphicalEditor.py	Mon Apr 05 23:37:52 2010 +0200
@@ -318,7 +318,16 @@
         themepath = '%s/%s' % (url_prefix_static, request.theme.name)
         smileypath = themepath + '/img'
         # auto-generating a list for SmileyImages does NOT work from here!
-        editor_size = int(request.user.edit_rows) * 22 # 22 height_pixels/line
+        text_rows = int(request.user.edit_rows)
+        if not text_rows:
+            # if no specific value is given for editor height, but 0, we
+            # compute the rows from the raw_body line count plus some
+            # extra rows for adding new text in the editor. Maybe this helps
+            # with the "double slider" usability issue, esp. for devices like
+            # the iphone where you can't operate both sliders.
+            current_rows = len(raw_body.split('\n'))
+            text_rows = max(10, int(current_rows * 1.5))
+        editor_size = text_rows * 22 # 22 height_pixels/line
         word_rule = self.word_rule()
 
         request.write("""