Author Topic: Resizing reply-window  (Read 4748 times)

Offline ontheair

  • Newbie
  • *
  • Posts: 5
Resizing reply-window
« on: March 02, 2015, 06:56:20 AM »
Hello everybody,

after upgrading roundcube from 1.0.0 to 1.1.0 there is a strange behaviour:

When replying an e-Mail, the field for the message is very small (just 5-6 lines) and can not be resized. So I just have a small field for my reply text and everything is scrolling.
Never had such a problem with previous versions of Roundcube (and I am using it since a very long time).

Tested in Firefox 35.x and Firefox 36.0.
Server: Debian Wheezy, lighttpd, PHP 5.3, MySQL

Thank you for any help or idea!

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,631
    • http://SKaero.com/
Re: Resizing reply-window
« Reply #1 on: March 02, 2015, 07:10:18 AM »
Are you using a custom skin? Did you update the skin files with the upgrade?

Offline ontheair

  • Newbie
  • *
  • Posts: 5
Re: Resizing reply-window
« Reply #2 on: March 02, 2015, 09:58:29 AM »
Sorry for the missing information. I am using the larry skin. It was updated within the updating process (via install.sh from the command line).
You are right, when switching to the classic skin, everything works as espected. When switching back to larry, the problem is there again.

But larry is not really a custom skin, since it is shipped with the installation files.
For now it looks like I have to switch back to classic to get rid of the problem. This means, my roundcube looks now.... VERY classic ;-)

Anybody see the same problem when using larry? Could this be a general bug in the current version?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,631
    • http://SKaero.com/
Re: Resizing reply-window
« Reply #3 on: March 02, 2015, 10:31:04 AM »
Try replacing the larry directory again since sometime files are not overwritten completely. Also make sure you clear your browser cache and test without any plugins enabled.

Offline ontheair

  • Newbie
  • *
  • Posts: 5
Re: Resizing reply-window
« Reply #4 on: March 02, 2015, 12:57:30 PM »
Quote
Also make sure you clear your browser cache

You are absolutely right... My fault. Thank you for your help!

Offline mdryan

  • Newbie
  • *
  • Posts: 5
Re: Resizing reply-window
« Reply #5 on: March 02, 2015, 11:51:05 PM »
Anyone else hitting this?

I also upgraded from 1.0.0 to 1.1.0 a few days ago and have the same problem. (On FF 35 and Chromium 40 but not with IE 11). Clearing the cache doesn't help. I had initially enabled the legacy browser plugin but disabling that doesn't help. A quick check with no plugins at all also doesn't help. I also updated with install.sh but have since replaced the larry skin folder entirely just in case. I haven't yet tried a completely clean install which is the obvious next step.

For me I see the same problem with the classic skin as well. It only happens on a reply, not on a new compose, and switching from HTML to plain text and back does fix things (although obviously looses the formatting).

Anyone else seen this (and ideally fixed it!), or can see anything obvious I've missed trying before I start getting too intimate with the js and css in an attempt to see what's going on.

Thanks in advance,

Matt

Offline ontheair

  • Newbie
  • *
  • Posts: 5
Re: Resizing reply-window
« Reply #6 on: March 03, 2015, 04:57:48 AM »
I have to revoke my previous post. The problem still occurs on different computers; clearing the cache does not help on this ones. So the problem is still present.

If there is some time later, I will replace the Larry directory again.

Offline alec

  • Hero Member
  • *****
  • Posts: 1,202
Re: Resizing reply-window
« Reply #7 on: March 03, 2015, 05:41:57 AM »
So, the problem here is small HTML editor window, right? The editor height is set using javascript using setTimeout() method. Which means it indeed may not work as expected on slow computers/browsers (or slow internet connection) or in case an error. It never happened to me on compose screen, but on other pages (from plugins) using html editor. Make sure there are no javascript errors when this happens. We'd need probably some workaround for this issue, like e.g. checking the element existence/size and calling the resize again if needed. Feel free to create a ticket at http://trac.roundcube.net.

Offline mdryan

  • Newbie
  • *
  • Posts: 5
Re: Resizing reply-window
« Reply #8 on: March 03, 2015, 04:58:17 PM »
Thanks @alec. That is indeed the issue. I'll check from the same network as the server later today to see if a faster network helps, although access over the wider Internet isn't particularly slow.

As a workaround resizing the browser (as happened when I went to view the javascript console...) causes the html editor to be resized. There aren't any javascript errors.

I'll raise a ticket once I can narrow things down a little more.

Thanks again,

Matt

Offline ontheair

  • Newbie
  • *
  • Posts: 5
Re: Resizing reply-window
« Reply #9 on: March 03, 2015, 10:51:22 PM »
I can confirm, that everythings works fine if the roundcube server and the client are both on the same local network (=fast connetcion). So it seems to be a problem with slower connections over the internet.

Offline alec

  • Hero Member
  • *****
  • Posts: 1,202
Re: Resizing reply-window
« Reply #10 on: March 04, 2015, 10:25:18 AM »
This probably will fix the issue:
Code: [Select]
diff --git a/program/js/editor.js b/program/js/editor.js
index 829373a..3fc5698 100644
--- a/program/js/editor.js
+++ b/program/js/editor.js
@@ -129,6 +129,15 @@ function rcube_text_editor(config, id)
       return;
     }
.
+    var area = $('#' + this.id),
+        height = $('div.mce-toolbar-grp:first', area.parent()).height();
+
+    // the editor might be still not fully loaded, making the editing area
+    // inaccessible, wait and try again
+    if (height > 200 || height > area.height()) {
+        return setTimeout(function () { ref.init_callback(event); }, 300);
+    }
+
     var css = {},
       elem = rcube_find_object('_from'),
       fe = rcmail.env.compose_focus_elem;

Offline alec

  • Hero Member
  • *****
  • Posts: 1,202
Re: Resizing reply-window
« Reply #11 on: March 11, 2015, 08:41:25 AM »

Offline mdryan

  • Newbie
  • *
  • Posts: 5
Re: Resizing reply-window
« Reply #12 on: March 11, 2015, 11:25:13 AM »
Seems someone else beat me to creating the ticket.

I can confirm that that patch appears to fix things.

Many, many thanks,

Matt