Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
When editing a preset, when you are on the layers & styles tab, the overlay layers table has a weight field which contains a checkbox element (screenshot attached).
This doesn't seem to make much sense and if you don't check the box in the weight column your layer will not show up on openlayers views.
Comment | File | Size | Author |
---|---|---|---|
openlayers-presets_overlays_weight.png | 112.66 KB | Agileware |
Comments
Comment #1
strk CreditAttribution: strk commentedI've seen this too, but can't reproduce on my own host. Must be dependent on the CSS.
Theoretically the 'weight' table header should _not_ be visible, and this is what happens for me.
If you want to help debugging, check out:
modules/openlayers_ui/includes/openlayers_ui.theme.inc
Search for drupal_add_tabledrag() call (around line 109)
That call can take 3 additional args: NULL, NULL, false
The last arg (false) instructs to hide or not the 'weight' widget.
When set to false you should see that the widget for 'weight' is a select, not a checkbox,
while the checkbox belongs to next column...
On my system, setting to true (the default) hides _both_ the widget _and_ the header.
Comment #2
Agileware CreditAttribution: Agileware commentedChanging the title as it is not a checkbox for the weight field but the enabled field.
The problem is just that the header of the weight field is not being hidden by tabledrag.js.
If I force display of the weight column as you suggested I get the select field and everything lines up correctly under their own headings.
After a quick investigation it looks the problem is jquery_update 2 (6.x-2.0-alpha1 or 6.x-2.x-dev).
The problem is occurring In that module's version of tabledrag.js at around line 115 where it does:
Here $('td:not(:hidden)', cell.parent()).index(cell.get(0)) is returning -1 because cell.get(0) is not found.
So columnIndex is 2 and headerIndex is 0.
That's as far as I got for now but if I downgrade to jquery_update 1.x it works as expected.
Using other draggable tables with jquery_update 2.x this problem doesn't seem to happen (menus & blocks pages). It seems to be only with this one table.
Comment #3
strk CreditAttribution: strk commentedThe specificity of this one is that the 'weight' field is not the first one.
I moved somewhere somewhere inside as I was having problems with it on the first column as well.
Anyway, if it's a bug with jquery I guess we can close this ?
Comment #4
Agileware CreditAttribution: Agileware commentedYeah, I came across this issue that refers to the first column problem - #368973: tabledrag.js: Drag handle is added to the weight-td if it's the first td and gets hidden
Yeah I guess it can be considered a jquery_update issue as it doesn't happen with other versions of jquery.
The fact I can't find another table that has the problem is annoying but I have not exactly been exhaustive in my search.