6.0.0-alpha12
6/12/25

[#7831] Special folder display with custom images broken in DIMP
Summary Special folder display with custom images broken in DIMP
Queue DIMP
Queue Version HEAD
Type Bug
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester wrobel (at) horde (dot) org
Created 01/08/2009 (5999 days ago)
Due
Updated 01/12/2010 (5630 days ago)
Assigned 02/09/2009 (5967 days ago)
Resolved 02/09/2009 (5967 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
02/09/2009 10:54:22 PM Michael Slusarz State ⇒ Resolved
 
02/09/2009 10:52:06 PM Gunnar Wrobel Comment #7
State ⇒ Assigned
Reply to this comment
Ah, then we are d'accord. I guess the misunderstanding originated from 
commit            af0f675 that Micheal hinted at and still used 
background-image. The second comit            96801ee - which I did not look 
at - fixed that. So the patch works fine and my backport to 
horde-webmail-1.2.0 is here: 
http://kolab.org/cgi-bin/viewcvs-kolab.cgi/server/patches/horde-webmail/1.2.0/tg/t_dimp_H_MS_FixBrokenFolderImages.diff?rev=1.2&content-type=text/vnd.viewcvs-markup
02/09/2009 04:04:50 PM Jan Schneider Comment #6 Reply to this comment
That's what Michael said. In JavaScript you have to use 
backgroundImage, in CSS you use background-image.
02/09/2009 03:58:19 PM Gunnar Wrobel Comment #5 Reply to this comment

[Show Quoted Text - 13 lines]
I'm confused now. When I applied your patch to the current 
horde-webmail release I got a JavaScript error and I assume the reason 
was that it was indeed invalid JavaScript.



I'm still not very used to JavaScript and have no clue about prototype 
either. I basically googled for the fix I described in my earlier 
comment. So I don't know if it is valid or not.



From your comment I don't understand if I should use 
'background-image' though. Using 'backgroundImage' as the argument 
works fine on my side and gets turned into the correct 
'background-image' attribute on the client.



Your comment does not directly invalidate this, does it? So what 
should I check on my side?
02/07/2009 09:01:36 PM Michael Slusarz Comment #4
State ⇒ Feedback
Reply to this comment
Works fine! I had to exchange the style name 'background-image'
against 'backgroundImage' in dimp/js/DimpBase.js though.
That is not correct.  From prototypejs API docs:



setStyle(element, styles) -> HTMLElementModifies elementÂ’s CSS style 
properties. Styles are passed as a hash of property-value pairs in 
which the properties are specified in their **camelized** form.



This is because this code:

{ background-image: foo }



isn't valid javascript (you can't have dashes in Object property names).
02/07/2009 08:38:04 PM Gunnar Wrobel Comment #3
State ⇒ Assigned
Reply to this comment
Works fine! I had to exchange the style name 'background-image' 
against 'backgroundImage' in dimp/js/DimpBase.js though.



Thanks for the patch!
02/05/2009 08:09:10 PM Michael Slusarz Comment #2
State ⇒ Feedback
Reply to this comment
All other special folders images in DIMP are handled via setting the
icon as a background image in the css. I don't know if the same would
be possible for folders with these customized images.
Yes - this is the proper way of fixing this.



Try this commit, which was just pushed to horde-hatchery:



commit af0f675507180ff5b4809a70721e0b08ec7ec54e

Author: Michael M Slusarz <slusarz@curecanti.org>

Date:   Thu Feb 5 13:04:59 2009 -0700



     Bug #7831: Fix custom folder image display in dimp



  imp/js/src/DimpBase.js     |    2 +-

  imp/lib/DIMP.php           |    9 +++++++--

  imp/themes/screen-dimp.css |    2 +-

  3 files changed, 9 insertions(+), 4 deletions(-)
01/12/2009 02:06:06 AM Chuck Hagenbuch State ⇒ Assigned
Assigned to Michael Slusarz
 
01/08/2009 11:12:07 AM Gunnar Wrobel Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Special folder display with custom images broken in DIMP
Queue ⇒ DIMP
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
If a folder within IMP has been configured to use a special image via 
the _imp_hook_mbox_icons hook this will lead to a broken folder 
display within DIMP. There will be a line break just after the image 
and the folder name will sit on top of the folder name in the next line.



All other special folders images in DIMP are handled via setting the 
icon as a background image in the css. I don't know if the same would 
be possible for folders with these customized images. _createFolderElt 
within dimp/lib/DIMP.php returns a full image tag (rather than just a 
url). And I don't know if the folder information generated by this 
function is used somewhere else. Otherwise it might be possible to 
modify the funtion to return a url here and add a background image 
style to the item.



A workaround is to add a "float: left" style to the div where the 
image tag is being added. See below.



diff -r 23c541337007 dimp/js/src/DimpBase.js

--- a/dimp/js/src/DimpBase.js   Thu Jan 08 11:03:29 2009 +0100

+++ b/dimp/js/src/DimpBase.js   Thu Jan 08 12:01:58 2009 +0100

@@ -1579,6 +1579,7 @@

          div = new Element('DIV', { className: ob.cl || 'base', id: 
fid + '_div' });

          if (ob.i) {

              div.update(ob.i);

+            div.setStyle(float:left);

          }

          if (ob.ch) {

              div.writeAttribute({ className: 'exp' 
}).observe('mouseover', this.bcache.get('mo_folder') || 
this.bcache.set('mo_folder', function(e) {


Saved Queries