This commit is contained in:
Julian Lam
2013-11-22 15:48:03 -05:00
parent 08ef67e824
commit 39f2efbef8
34 changed files with 799 additions and 92 deletions

View File

@@ -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);
}
});
});
});
};