added public/src/admin.js; moved enableColorPicker into admin.enableColorPicker

This commit is contained in:
psychobunny
2014-05-14 18:46:11 -04:00
parent e2312c8330
commit 29137299c2
2 changed files with 27 additions and 12 deletions

19
public/src/admin.js Normal file
View File

@@ -0,0 +1,19 @@
"use strict";
var admin = {};
(function() {
admin.enableColorPicker = function(inputEl, callback) {
inputEl.ColorPicker({
color: inputEl.val() || '#000',
onChange: function(hsb, hex) {
inputEl.val('#' + hex);
if (typeof callback === 'function') {
callback(hsb, hex);
}
}
});
};
}());