implement et2_label_empty class for all set_label methods and remove no longer necessary label.et2_label > input[type="checkbox"], as it is covered by the standard case

This commit is contained in:
Ralf Becker 2016-03-31 13:05:03 +00:00
parent df2791ab63
commit ac6b0e9a94
5 changed files with 13 additions and 2 deletions

View File

@ -2873,8 +2873,10 @@ var et2_nextmatch_header = (function(){ "use strict"; return et2_baseWidget.exte
this.label = _value; this.label = _value;
this.labelNode.text(_value); this.labelNode.text(_value);
// add class if label is empty
this.labelNode.toggleClass('et2_label_empty', !_value);
} }
});}).call(this); });}).call(this);
et2_register_widget(et2_nextmatch_header, ['nextmatch-header']); et2_register_widget(et2_nextmatch_header, ['nextmatch-header']);

View File

@ -182,6 +182,9 @@ var et2_description = (function(){ "use strict"; return expose(et2_baseWidget.ex
this._labelContainer.append(ph); this._labelContainer.append(ph);
} }
} }
// add class if label is empty
this._labelContainer.toggleClass('et2_label_empty', !_value || !parts[0]);
} }
else else
{ {

View File

@ -1118,6 +1118,9 @@ var et2_link = (function(){ "use strict"; return et2_valueWidget.extend([et2_IDe
this.label_span.prepend(parts[0]); this.label_span.prepend(parts[0]);
this.label_span.append(parts[1]); this.label_span.append(parts[1]);
this.label = label; this.label = label;
// add class if label is empty
this.label_span.toggleClass('et2_label_empty', !label || !parts[0]);
}, },
set_value: function(_value) { set_value: function(_value) {
if(typeof _value != 'object' && _value && !this.options.only_app) if(typeof _value != 'object' && _value && !this.options.only_app)

View File

@ -354,6 +354,9 @@ var et2_textbox_ro = (function(){ "use strict"; return et2_valueWidget.extend([e
this.span.prepend(parts[0]); this.span.prepend(parts[0]);
this.span.append(parts[1]); this.span.append(parts[1]);
this.label = label; this.label = label;
// add class if label is empty
this.span.toggleClass('et2_label_empty', !label || !parts[0]);
}, },
set_value: function(_value) set_value: function(_value)
{ {

View File

@ -151,7 +151,7 @@ div.et2_hbox > div {
label.et2_label > * { label.et2_label > * {
margin-left: 5px !important; margin-left: 5px !important;
} }
label.et2_label > input[type="checkbox"], label.et2_label.et2_label_empty > * { label.et2_label.et2_label_empty > * {
margin-left: 0 !important; margin-left: 0 !important;
} }
#msg, #msg,