bootstrap-colorpickersliders
bootstrap-colorpickersliders copied to clipboard
ColorPickerSliders and Bootstrap.js ver 3.3.2 issues
There are strange behaviors with bootstrap-colorpickersliders and the latest (as of this date) version of Bootstrap.js (ver. 3.3.2) When using 3.3.2 instead of the included 3.0.3, colorpickersliders.js is writing 4, 8 or more copies of the current color to the localstorage, and displaying all these extra copies in the swatches palette when saving a color to the palette.
On version 3.3.6 of Bootstrap.js it will save 8 copies on the first time and as many as it can save on the second, freezing the browser.
Edit:
It seems every time you switch tabs, _bindControllerEvents()
is called and it goes multiplying on each click.
This can be fixed by just changing the bootstrap.colorpickersliders.js as follows: Tested for bootstrap 3.3.7
NEED TO CHANGE:
elements.swatches.on('touchstart mousedown click', 'li span', function(ev) {
var color = $(this).css('background-color');
updateColor(color);
//_updateAllElements();
ev.preventDefault();
});
elements.swatches_add.on('touchstart mousedown click', function(ev) {
_addCurrentColorToSwatches();
ev.preventDefault();
ev.stopPropagation();
});
CHANGE IT TO:
elements.swatches.on('touchstart click', 'li span', function(ev) {
var color = $(this).css('background-color');
updateColor(color);
//_updateAllElements();
ev.preventDefault();
});
elements.swatches_add.on('touchstart click', function(ev) {
if (ev.type === 'click' || ev.type === 'touchstart')
{
_addCurrentColorToSwatches();
}
ev.preventDefault();
ev.stopImmediatePropagation();
});