mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-24 16:29:51 +01:00
23 lines
426 B
JavaScript
23 lines
426 B
JavaScript
"use strict";
|
|
|
|
var admin = {};
|
|
|
|
(function() {
|
|
|
|
admin.enableColorPicker = function(inputEl, callback) {
|
|
(inputEl instanceof jQuery ? inputEl : $(inputEl)).each(function() {
|
|
var $this = $(this);
|
|
|
|
$this.ColorPicker({
|
|
color: $this.val() || '#000',
|
|
onChange: function(hsb, hex) {
|
|
$this.val('#' + hex);
|
|
if (typeof callback === 'function') {
|
|
callback(hsb, hex);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
};
|
|
|
|
}()); |