Change ComboBoxColor component: show displayValue
This commit is contained in:
parent
f88966764a
commit
04a2b32cc1
|
@ -271,7 +271,7 @@ define([
|
|||
|
||||
Common.UI.ComboBoxColor = Common.UI.ComboBox.extend(_.extend({
|
||||
template: _.template([
|
||||
'<div class="input-group combobox input-group-nr <%= cls %>" id="<%= id %>" style="<%= style %>">',
|
||||
'<div class="input-group combobox combo-color input-group-nr <%= cls %>" id="<%= id %>" style="<%= style %>">',
|
||||
'<div class="form-control" style="padding:2px 14px 2px 3px; <%= style %> display: block;">',
|
||||
'<div style="display: inline-block;overflow: hidden;width: 100%;height: 100%;"></div>',
|
||||
'</div>',
|
||||
|
@ -309,12 +309,13 @@ define([
|
|||
updateFormControl: function(record) {
|
||||
var formcontrol = $(this.el).find('.form-control > div');
|
||||
|
||||
if (record.get('value')!=-1) {
|
||||
formcontrol[0].innerHTML = '';
|
||||
formcontrol.css({'background': '#' + record.get('value'), 'margin-top': '0'});
|
||||
} else {
|
||||
formcontrol[0].innerHTML = record.get('displayValue');
|
||||
if (record.get('value')!=-1) {
|
||||
formcontrol.css({'background': '#' + record.get('value'), 'margin-top': '0'});
|
||||
record.get('displayColor') && formcontrol.css({'color': '#' + record.get('displayColor'), 'text-align': 'center'});
|
||||
} else {
|
||||
formcontrol.css({'background': '', 'margin-top': '1px'});
|
||||
formcontrol.css({'color': '', 'text-align': ''});
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -44,3 +44,9 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.combo-color {
|
||||
.form-control:not(input) {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
|
@ -268,7 +268,7 @@ define([ 'text!spreadsheeteditor/main/app/template/SortDialog.template',
|
|||
if (item)
|
||||
color_data.push({
|
||||
value: Common.Utils.ThemeColor.getHexColor(item.get_r(), item.get_g(), item.get_b()).toLocaleUpperCase(),
|
||||
displayValue: Common.Utils.ThemeColor.getHexColor(item.get_r(), item.get_g(), item.get_b()).toLocaleUpperCase(),
|
||||
displayValue: '',
|
||||
color: item
|
||||
});
|
||||
else
|
||||
|
@ -555,7 +555,7 @@ define([ 'text!spreadsheeteditor/main/app/template/SortDialog.template',
|
|||
var value = item ? Common.Utils.ThemeColor.getHexColor(item.get_r(), item.get_g(), item.get_b()).toLocaleUpperCase() : -1,
|
||||
color_data = {
|
||||
value: value,
|
||||
displayValue: item ? value : ((level.cmbSort.getValue()==Asc.c_oAscSortOptions.ByColorFill) ? me.textNone : me.textAuto),
|
||||
displayValue: item ? '' : ((level.cmbSort.getValue()==Asc.c_oAscSortOptions.ByColorFill) ? me.textNone : me.textAuto),
|
||||
color: item
|
||||
};
|
||||
item ? level.color_data.push(color_data) : level.color_data.unshift(color_data);
|
||||
|
|
Loading…
Reference in a new issue