|
|
@ -29,7 +29,8 @@ BI.SimpleHexColorPickerEditor = BI.inherit(BI.Widget, { |
|
|
|
var checker = function (v) { |
|
|
|
var checker = function (v) { |
|
|
|
return BI.isNumeric(v) && (v | 0) >= 0 && (v | 0) <= 255; |
|
|
|
return BI.isNumeric(v) && (v | 0) >= 0 && (v | 0) <= 255; |
|
|
|
}; |
|
|
|
}; |
|
|
|
var Ws = BI.createWidgets([{}, {}, {}], { |
|
|
|
var Ws = BI.map(BI.range(0, 3), function () { |
|
|
|
|
|
|
|
return { |
|
|
|
type: "bi.small_text_editor", |
|
|
|
type: "bi.small_text_editor", |
|
|
|
cls: "color-picker-editor-input", |
|
|
|
cls: "color-picker-editor-input", |
|
|
|
validationChecker: checker, |
|
|
|
validationChecker: checker, |
|
|
@ -48,10 +49,8 @@ BI.SimpleHexColorPickerEditor = BI.inherit(BI.Widget, { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}] |
|
|
|
}] |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.R = Ws[0]; |
|
|
|
|
|
|
|
this.G = Ws[1]; |
|
|
|
|
|
|
|
this.B = Ws[2]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
type: "bi.vertical", |
|
|
|
type: "bi.vertical", |
|
|
@ -95,13 +94,25 @@ BI.SimpleHexColorPickerEditor = BI.inherit(BI.Widget, { |
|
|
|
} |
|
|
|
} |
|
|
|
}] |
|
|
|
}] |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
el: this.R, |
|
|
|
el: BI.extend(Ws[0], { |
|
|
|
|
|
|
|
ref: function (_ref) { |
|
|
|
|
|
|
|
self.R = _ref |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}), |
|
|
|
width: c.RGB_WIDTH |
|
|
|
width: c.RGB_WIDTH |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
el: this.G, |
|
|
|
el: BI.extend(Ws[1], { |
|
|
|
|
|
|
|
ref: function (_ref) { |
|
|
|
|
|
|
|
self.G = _ref |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}), |
|
|
|
width: c.RGB_WIDTH |
|
|
|
width: c.RGB_WIDTH |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
el: this.B, |
|
|
|
el: BI.extend(Ws[2], { |
|
|
|
|
|
|
|
ref: function (_ref) { |
|
|
|
|
|
|
|
self.B = _ref |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}), |
|
|
|
width: c.RGB_WIDTH |
|
|
|
width: c.RGB_WIDTH |
|
|
|
}] |
|
|
|
}] |
|
|
|
}, { |
|
|
|
}, { |
|
|
|