#1488261 closed Bugs (fixed)

rcmail.add_element() layout problem on Firefox

Reported by: m.kefeder Owned by:
Priority: 5 Milestone: 0.8-beta
Component: User Interface Version: 0.7
Severity: normal Keywords:
Cc:

Description

Hi, I am adding a custom button to the toolbar in my plugin. When doing so it works fine, but on the single message view (the one after double clicking any message in message list) the selectbox "move to..." for mailboxes moves my button below the selectbox. This is only a problem in Firefox, so it is a CSS issue I guess. When changing the order of html-elements it displays fine in firefox aswell, but doing that requires a crazy hack ;)
I don't know how to fix this for good. I am also not sure if that is a user-interface issue or a plugin API issue. However it's fixed, in the end it is a workaround for firefoxes broken layout engine - dunno if that's an option you guys even consider.

Steps to reproduce:

  1. rcmail.add_element(button, 'toolbar');
  2. go to full message view in firefox

plugin with the problem:
http://code.google.com/p/rcmail-thunderbird-labels/

crazy hack to make selectbox last html element:

--- program/js/app.js   (Revision 5293)
+++ program/js/app.js   (Arbeitskopie)
@@ -107,7 +107,20 @@
   this.add_element = function(elm, container)
   { 
     if (this.gui_containers[container] && this.gui_containers[container].jquery)
-      this.gui_containers[container].append(elm);
+    {
+      var selbox = this.gui_containers[container].children('select.mboxlist');
+      if (selbox.length)
+      {
+        var selectbox = selbox.clone();
+        selbox.remove();
+
+        this.gui_containers[container].append(elm);
+        this.gui_containers[container].append(selectbox);
+      }
+      else
+        this.gui_containers[container].append(elm);
+    }
   };

   // register an external handler for a certain command

Attachments (1)

roundcube_firefox_problem.png (53.7 KB) - added by m.kefeder 18 months ago.
screenshot showing the problem

Download all attachments as: .zip

Change History (4)

Changed 18 months ago by m.kefeder

screenshot showing the problem

comment:1 Changed 18 months ago by alec

  • Milestone changed from later to 0.8-beta

Confirmed with Firefox 3.6. You can add the button in PHP (see archive plugin). I think we would remove this select field (move it to actions menu) in next release.

comment:2 Changed 18 months ago by m.kefeder

I was able to try the add_button() function as used in the archive plugin with my code. Works fine in all browsers, thanks a lot for that hint! The button is now on a different location, I hope my users don't object to that.

Moving the select field to another html-code block (e.g. actions menu) is probably the easiest and most sensible workaround for a bug that's actually in another software. I likely have no say in this but I vote for that solution ;)

comment:3 Changed 16 months ago by alec

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [aa2013bd].

Note: See TracTickets for help on using tickets.