Cannot override display:inline-block on $EDITOR div

Post any questions regarding Installing or Upgrading to V5, including problems starting and using the Ebase Server or Designer

Moderators: Jon, Steve, Ian, Dave

User avatar
dvanhussel
Ebase User
Posts: 161
Joined: Fri Oct 19, 2007 12:45 pm
Location: Haarlem, the Netherlands

Cannot override display:inline-block on $EDITOR div

#1

Postby dvanhussel » Wed Sep 09, 2015 10:07 am

Hi,

This is probably not only Version 5, but I'm using the V5 beta now, thats why I post it here.

I have a custom template that only contains: $LABEL and $EDITOR to display fields. (No field headers or footers).

The field I want to display is of type textarea. The deditor has a css class:

Code: Select all

.client-comment{
    width:100%;
}
When te form is run, the textarea is not taking 100% width. This is because Ebase encloses the editor field in a div that has style="inline-block".

I cannot find where/how i can add a class to this div. If i add a class to the 'root' of the field, it is not added here.

I have 'fixed' it for now by adding

Code: Select all

div {
	display:block !important;	
}
Is there a better way to do this?

Regards,

David
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Wed Sep 09, 2015 11:56 am

David,

You can style this inline block div using the styling assistant of the Field Control, select Editor Cell, Advanced Properties, then Style. If you add width:100% here it should work. If you added this to the presentation template, it would be applied to all fields, but I think it is only actually applied by the browsers to textareas so this probably works fine i.e. fields with regular text boxes as opposed to textareas will take their width from the display length property and will not be displayed as full width.

An alternative, not documented, is to add this to the first row of your custom layout:
#set ($MINIMAL_HTML = true)
This removes the offending inline block div. I suspect that there might be a cost but I'm not too sure what - possibly adding client side events using HTML Element properties might not work. If this is acceptable, it's quite a good solution.

This applies equally to V4 and V5.

Jon
0 x

User avatar
dvanhussel
Ebase User
Posts: 161
Joined: Fri Oct 19, 2007 12:45 pm
Location: Haarlem, the Netherlands

#3

Postby dvanhussel » Wed Sep 09, 2015 12:00 pm

Hi Jon,

As I don't need any clientside interaction with this part of the form, the second solution works perfectly!

Thanks,

David
0 x


Who is online

Users browsing this forum: No registered users and 2 guests