mirror of
https://github.com/HeyPuter/puter.git
synced 2026-09-24 06:05:40 +00:00
Co-authored-by: devareddy05 <pdevendrareddy@guidewire.com>
This commit is contained in:
co-authored by
devareddy05
parent
eb9e316ed5
commit
b3bf979cac
@@ -74,7 +74,7 @@ async function UIWindowColorPicker (options) {
|
||||
},
|
||||
onAppend: function (window) {
|
||||
colorPickerWidget = UIColorPickerWidget($(window).find('.picker'), {
|
||||
default: options.default ?? '#f00',
|
||||
default: options.defaultValue ?? options.default ?? '#f00',
|
||||
});
|
||||
},
|
||||
window_class: 'window-login',
|
||||
|
||||
@@ -881,7 +881,7 @@ class UI extends EventListener {
|
||||
return new Promise((resolve) => {
|
||||
const opts = typeof options === 'string' ? { defaultColor: options } : (options ?? {});
|
||||
const el = document.createElement('puter-color-picker');
|
||||
const defaultColor = opts.defaultColor || opts.default || '#3b82f6';
|
||||
const defaultColor = opts.defaultValue || opts.defaultColor || opts.default || '#3b82f6';
|
||||
el.setAttribute('default-color', defaultColor);
|
||||
el.addEventListener('response', (e) => resolve(e.detail));
|
||||
document.body.appendChild(el);
|
||||
|
||||
Reference in New Issue
Block a user