Open wizlonuk opened 8 years ago
Hi @wizlonuk, I'm not quite sure what you need to do...
renderMemory(ff.global.memoryColors)
to set them, even after your colorPicker is loaded already.colorPickerMemos
set in cookies. If not, use renderMemory()
to set them, otherwise not... don't set them in your options though...Best to do so is inside the actionCallback
because it's the first time you have a hold on the instance of your colorPicker (this._instance
):
actionCallback: function(event, type) {
if (type === 'init') { // the first time you created an instance
if (document.cookie.indexOf('colorPickerMemos') !== -1) {
this._instance.renderMemory(ff.global.memoryColors);
}
}
}
I hope this helps you with what you need to do ;o)
Hi
First of all, thanks for the amazing colour picker, it's got all the features I need (and more) which can't be said for others. But I was hoping you could help me out with something.
I am initialising the plugin using JQuery as so
$('#addNewColourInput').colorPicker({ memoryColors: ff.global.memoryColors, actionCallback: actionCallback )};
which works fine, but I am trying to add new memory colours after a selection has been made. I was hoping to keep my own list of colours and then just reset the memory colours object when I need to, however, I'm haping trouble doing this. Could you supply a snippet showing how I can set the memoryColours? If this isn't possible then how else could I achieve this?
Thank you for your time.