mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 07:25:46 +01:00
closed #540
This commit is contained in:
@@ -10,6 +10,8 @@ define(function() {
|
||||
modified_categories[cid] = modified_categories[cid] || {};
|
||||
modified_categories[cid][$(el).attr('data-name')] = $(el).val();
|
||||
}
|
||||
|
||||
console.log(modified_categories);
|
||||
}
|
||||
|
||||
function save() {
|
||||
@@ -129,7 +131,7 @@ define(function() {
|
||||
update_blockclass(ev.target);
|
||||
});
|
||||
|
||||
jQuery('.category_name, .category_description, .blockclass').on('change', function(ev) {
|
||||
jQuery('.category_name, .category_description, .blockclass .category_bgColor').on('change', function(ev) {
|
||||
modified(ev.target);
|
||||
});
|
||||
|
||||
@@ -156,6 +158,20 @@ define(function() {
|
||||
return false;
|
||||
});
|
||||
|
||||
// Colour Picker
|
||||
$('[data-name="bgColor"], [data-name="color"]').each(function(idx, inputEl) {
|
||||
var jinputEl = $(this),
|
||||
parentEl = jinputEl.parents('[data-cid]');
|
||||
jinputEl.ColorPicker({
|
||||
color: this.value || '#000',
|
||||
onChange: function(hsb, hex) {
|
||||
jinputEl.val('#' + hex);
|
||||
if (inputEl.getAttribute('data-name') === 'bgColor') parentEl.css('background', '#' + hex);
|
||||
else if (inputEl.getAttribute('data-name') === 'color') parentEl.css('color', '#' + hex);
|
||||
modified(inputEl);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user