mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Making cells colors effective also in Card and Card List views
Summary: . Makes cell color work well in comparison mode . Do not apply cell color to the add new row . Allow to change color for all widget (including changing color for the checkbox and the switch widget) . Fix an issue that was setting color to black when opening the picker . Do not apply color to invalid cell Test Plan: . Added nbrowser/CellColor Reviewers: paulfitz, dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2720
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import {delay} from 'app/common/delay';
|
||||
import {Listener, Observable} from 'grainjs';
|
||||
import {BindableValue, DomElementMethod, Listener, Observable, subscribeElem} from 'grainjs';
|
||||
import {Observable as KoObservable} from 'knockout';
|
||||
import constant = require('lodash/constant');
|
||||
import identity = require('lodash/identity');
|
||||
@@ -727,6 +727,17 @@ export async function waitGrainObs<T>(observable: Observable<T>,
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
// `dom.style` does not work here because custom css property (ie: `--foo`) needs to be set using
|
||||
// `style.setProperty` (credit: https://vanseodesign.com/css/custom-properties-and-javascript/).
|
||||
// TODO: consider making PR to fix `dom.style` in grainjs.
|
||||
export function inlineStyle(property: string, valueObs: BindableValue<string>): DomElementMethod {
|
||||
return (elem) => subscribeElem(elem, valueObs, (val) => {
|
||||
elem.style.setProperty(property, val);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Class to maintain a chain of promise-returning callbacks. All scheduled callbacks will be
|
||||
* called in order as long as the previous one is successful. If a callback fails is rejected,
|
||||
|
||||
Reference in New Issue
Block a user