summaryrefslogtreecommitdiff
path: root/addons/website/static/src/css/editor.sass
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2013-12-18 12:49:01 +0100
committerXavier Morel <xmo@openerp.com>2013-12-18 12:49:01 +0100
commit90a9e522f3190a314fca289066943f312cd637f3 (patch)
treedc8ecfcb563583e469774eac8739284acf1beac3 /addons/website/static/src/css/editor.sass
parent128f1e1281a640d21cb4ef7b587f66fdffc4ce7f (diff)
[ADD] placeholder support on t-field
A placeholder is looked up: 1. in the field's options ("placeholder") 2. on the t-field node itself (@placeholder) 3. on the field's column (.placeholder) The first one found is used as the @placeholder of the resulting node (in-HTML), and displayed when the field is empty and unfocused. If no placeholder is found, an empty field just gets a small padding in order to be easier to see & focus. bzr revid: xmo@openerp.com-20131218114901-xi3ye11x5pysq2a2
Diffstat (limited to 'addons/website/static/src/css/editor.sass')
-rw-r--r--addons/website/static/src/css/editor.sass15
1 files changed, 12 insertions, 3 deletions
diff --git a/addons/website/static/src/css/editor.sass b/addons/website/static/src/css/editor.sass
index 38b1d9f3436..ff62f416d8d 100644
--- a/addons/website/static/src/css/editor.sass
+++ b/addons/website/static/src/css/editor.sass
@@ -171,11 +171,20 @@ ul.oe_menu_editor
// Breaks completely horribly crazy products listing page, so take it out.
.cke_widget_wrapper
position: static !important
+
// prevent inline widgets from entirely disappearing when their (textual)
// content is removed
-.cke_widget_editable:empty:after
- content: " "
- white-space: pre-wrap
+.cke_widget_editable
+ // basic config
+ &:empty:after
+ opacity: 0.3
+ white-space: pre-wrap
+ // no @placeholder -> just add some padding
+ &:not([placeholder]):empty::after
+ content: " "
+ // with placeholder and when not (yet) focused -> display placeholder
+ &[placeholder]:not(:focus):empty::after
+ content: attr(placeholder)
.oe_carlos_danger
outline: 1px solid red !important