Closed (outdated)
Project:
Homebox - Individual user dashboards
Version:
6.x-3.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
21 Dec 2009 at 16:46 UTC
Updated:
17 Dec 2017 at 21:10 UTC
Jump to comment: Most recent
Comments
Comment #1
jchatard commentedWell I have to admit I've never tested this kind of situation, but I guess Google Gadget are sort of iFrame stuff.
Could you digg a little?
Thanks,
Jérémy
Comment #2
itsnotme commentedI have a similar problem with a block in which a weather forecast is included.
The code in question is:
The problem is reproducible and persistent in Firefox and Chrome. (Opera 10 and IE 8 mostly seem to work - few problems, not reproducible.)
My version is 6.2x dev of today, October 4th.
Comment #3
mstef commentedI think I know the problem. It seems that if a block with js or flash is dragged and dropped, the content inside is reloaded by the browser. So a problem is either occurring with Homebox or the script itself. I'll try looking into it.
Comment #4
nibo commentedI am also interested in this issue. I'm not 100% sure, but I think, that in the previous version 2.0 the problem wasn't there ...
Comment #5
d0t101101 commentedSubscribing, also facing this issue...
Comment #6
mlconnor commentedThis issue appears to be caused because jQuery reruns the scripts in the blocks when the block has been dropped.
The key to solving this issue is to prevent the scripts from running a second time. My first thought was simply to add the JavaScript for the block (in my case it creates a Twitter widget) to the .ready() function so that it would only run once but that didn't solve it for me.
It would be great if there were a flag in jQuery that would indicate whether or not .ready() had been called so that you could check that and only run scripts if .ready() had not been called. Until I find something, I was able to fix this by creating a flag in the .ready() function that I could check later. So somewhere on the page you have to...
...and then in each block HTML (not PHP) where there are scripts that you don't want to run twice you can wrap them with...
Can anyone think of an easier way to check whether ready was fired yet?
Comment #7
mstef commentedYes I can, and I had a feeling I left this out..
You need to add a 'processed' class to everything select in jQuery, after you select it. Upon selecting, you only grab items that weren't 'processed'. This way the events are only attached once and things don't blow up..
Example:
Make sense? I'll get it fixed..
Comment #8
mlconnor commentedmikesteff, i see that you add a homebox-processed class to all of the widgets. are you saying that the existing code erroneously reprocesses items that already have the homebox-processed flag? if so, am i right to assume that you plan to fold the code you provided above back into the code base?
thanks for all your work on this. it's a great module and i hope i can help to make it better. i think it's getting really close.
Comment #9
itsnotme commentedmikesteff, any plans when to add the fix? I'd do it myself with a patch but I'm not sure where to add the solution :)
*eagerly waiting*
Comment #10
mlconnor commentedI've changed my widget code a little bit to get around this issue. In my block I add the following code...
I'm still trying to figure out how to implement this from the actual homebox code instead of hacking each block. Any thoughts?
Comment #11
mlconnor commentedOne of the Google gadgets I'm running has a simple
tag. That script tag adds an iframe via a document.write. Document.write appears to blow away your entire page. One way I was able to solve this is by removing the script that constructs the gadget in .ready(). Vicious hack.Comment #12
brianV commentedBumping version since 6.x-2.x is no longer being developed.
Comment #13
drummD6 is no longer supported. If this can be reproduced with Drupal 7, please re-open with details.