For a desktop/ mobile layout i created a 25/50/25 homebox layout. On mobile layouts all columns have 100% width and the middle column should be on top of all other columns. On desktop layout the three columns are displayed as usual - floating left to each other..
To achieve my desired mobile layout - i buildt the markup manually and ordered the elements in following manner: (just duplicated the markup created by standard for-each loop and added correct ids/ classes)
- homebox-column-wrapper-2
- homebox-column-wrapper-1
- homebox-column-wrapper-3
With the help of some CSS and negative margins the layout works as expected.
But after dragging a box to another region / auto-saving and reloading the page, the blocks are not on the position they should be.
Move block from right to center

Position of block after saving

i already checked all my DOM-id and the rest of the markup - if i put the "manual markup" in the correct order everything is working fine here.
Thx for your help.
SteffenR
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | determine_region_by_column_id-1979994-8.patch | 1.13 KB | steffenr |
| #5 | determine_region_by_column_id-1979994-5.patch | 721 bytes | steffenr |
| #1 | box_not_center.jpg | 160.32 KB | steffenr |
| #1 | move_to_center.jpg | 147.65 KB | steffenr |
Comments
Comment #0.0
steffenrchanged image pathes
Comment #1
steffenrAdd screenshot images
Comment #1.0
steffenrImage pathes
Comment #1.1
steffenruploaded image to drupal.org
Comment #2
stborchertSimple fix in line 46 of homebox.js:
Before:
colIndex = colIndex + 1;After:
colIndex = $(this).attr('id').replace(/homebox-column-/, '');After making this change the blocks are saved in the correct region again.
Comment #3
drummLooks like a good change. I think we can go ahead and remove
colIndexas a parameter, and declare it as avar, maybe with a better name.Comment #4
drummComment #5
steffenrHi stborchert,
thx for sharing your simple fix. Attached you'll find a patch i did against the latest DEV of the module.
SteffenR
Comment #6
steffenrComment #7
stborchertcolIndexis now defined twice (as var and as parameter).I guess changing the name to "regionIndex" or something similar would be good since this is exactly whats its meant to be ;)
Comment #8
steffenrHi stborchert - attached you find an updated patch solving the issue you mentioned.
SteffenR
Comment #9
stborchertThanks for the patch. Committed to 7.x-2.x.
Comment #10.0
(not verified) commentedchanged wording for better understanding