block form layout messed up because of class 'ccm-ui' missing in enclosing div
Permalink 1 user found helpful
Hi,
I’ve struggling quite some time to figure out why the ccm-ui classes did not apply properly onto my newly generated form within an edit block.
It seems that for some reason, the enclosing div of the form tag does not have the "ccm-ui" class.
To fix this, i have to copy-paste the code I found in the form block’s auto.js :
This made the form work perfectly, but (as the comment states), it really looks like an ugly hack to fix a bug ...
This is actually caused by the order things are setup in the legacy.less file :
That piece of code imply that the form tag must be enclosed by a .ccm-ui class holding tag.
Is this a "bug" or I am doing something wrong ? (and if so what?)
I’ve struggling quite some time to figure out why the ccm-ui classes did not apply properly onto my newly generated form within an edit block.
It seems that for some reason, the enclosing div of the form tag does not have the "ccm-ui" class.
To fix this, i have to copy-paste the code I found in the form block’s auto.js :
$(document).ready(function(){ /* TODO hackzors, this shouldnt be necessary */ $('#ccm-block-form').closest('div').addClass('ccm-ui'); });
This made the form work perfectly, but (as the comment states), it really looks like an ugly hack to fix a bug ...
This is actually caused by the order things are setup in the legacy.less file :
.ccm-ui { [...] form .input { margin-left: 160px } [...] }
That piece of code imply that the form tag must be enclosed by a .ccm-ui class holding tag.
Is this a "bug" or I am doing something wrong ? (and if so what?)
Quote :
[...]
You've got a JavaScript to add ccm-ui but could probably also add this to your block controller:
here's an example:
https://github.com/concrete5/concrete5/blob/master/web/concrete/core...