6.0.0-git
2019-04-24

[#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 2009-01-08 (3758 days ago)
Due
Updated 2010-01-12 (3389 days ago)
Assigned 2009-02-09 (3726 days ago)
Resolved 2009-02-09 (3726 days ago)
Milestone
Patch No

History
2009-02-09 22:54:22 Michael Slusarz State ⇒ Resolved
 
2009-02-09 22:52:06 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
2009-02-09 16:04:50 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.
2009-02-09 15:58:19 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?
2009-02-07 21:01:36 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).
2009-02-07 20:38:04 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!
2009-02-05 20:09:10 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(-)
2009-01-12 02:06:06 Chuck Hagenbuch Assigned to Michael Slusarz
State ⇒ Assigned
 
2009-01-08 11:12:07 Gunnar Wrobel Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Summary ⇒ Special folder display with custom images broken in DIMP
Queue ⇒ DIMP
Milestone ⇒
Patch ⇒ No
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