mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
9e4d802405
Summary: Conditional formatting can now be used for whole rows. Related fix: - Font styles weren't applicable for summary columns. - Checkbox and slider weren't using colors properly Test Plan: Existing and new tests Reviewers: paulfitz, georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D3547
40 lines
984 B
JavaScript
40 lines
984 B
JavaScript
var dom = require('../lib/dom');
|
|
var dispose = require('../lib/dispose');
|
|
var _ = require('underscore');
|
|
var kd = require('../lib/koDom');
|
|
var AbstractWidget = require('./AbstractWidget');
|
|
|
|
/**
|
|
* CheckBox - A bi-state CheckBox widget
|
|
*/
|
|
function CheckBox(field) {
|
|
AbstractWidget.call(this, field, {defaultTextColor: '#606060'});
|
|
}
|
|
dispose.makeDisposable(CheckBox);
|
|
_.extend(CheckBox.prototype, AbstractWidget.prototype);
|
|
|
|
CheckBox.prototype.buildConfigDom = function() {
|
|
return null;
|
|
};
|
|
|
|
CheckBox.prototype.buildDom = function(row) {
|
|
var value = row[this.field.colId()];
|
|
console.log(this);
|
|
return dom('div.field_clip',
|
|
dom('div.widget_checkbox',
|
|
dom.on('click', () => {
|
|
if (!this.field.column().isRealFormula()) {
|
|
value.setAndSave(!value.peek());
|
|
}
|
|
}),
|
|
dom('div.widget_checkmark',
|
|
kd.show(value),
|
|
dom('div.checkmark_kick'),
|
|
dom('div.checkmark_stem')
|
|
)
|
|
)
|
|
);
|
|
};
|
|
|
|
module.exports = CheckBox;
|