itsjavi / bootstrap-colorpicker

Bootstrap Colorpicker is a modular color picker plugin for Bootstrap.
https://itsjavi.com/bootstrap-colorpicker/
MIT License
1.38k stars 367 forks source link

config not working #253

Closed micksp closed 6 years ago

micksp commented 6 years ago

Description

I'm using the data-color option to initailly fill the box. This works. However, I don't want hash before the color and the transparancy.

HTML

<div id="cp-tutor" data-color="#de1d31" class="input-group" >
    <input type="text" name="calcolor" class="form-control input-lg"/>
    <span class="input-group-addon"><i></i></span>
</div>

Javascript

$('#cp-tutor').colorpicker({
      useAlpha: false,
      useHashPrefix: false
});

The colorpicker works, it displays the initial color and I can pick a new color. But the alpha and hash are stille there. I'm sure it's something I do wrong, in jsfiddle it works fine, exactly as shown here. I tried setting the construction after a timeout of 5 seconds, to make sure everything is loaded. That doesn't help. I tried using color: #de1d31, doesnt work either. Any help much appreciated!

Context

itsjavi commented 6 years ago

Hi @micksp I see that you are using the options for v3.0 of the plugin, but the plugin version you are using is 2.5.2. The v2 docs are here https://farbelous.github.io/bootstrap-colorpicker/v2/

sorry for the confusion, I will make this clearer asap.

micksp commented 6 years ago

I see. Still, if i use npm install bootstrap-colorpicker as stated on the v3.0 page, I really get v2.5.2. Is there a v3 package available through npm? I'd rather keep using npm for my package management.

itsjavi commented 6 years ago

v3 is not yet available in npm, since we have many open bug tickets that need to be addressed first, but I am considering to release it as beta pre-release or via @next.

itsjavi commented 6 years ago

@micksp The version 3.0.0-beta.1 is now available via npm, also as next (e.g. via npm i bootstrap-colorpicker@next )

https://www.npmjs.com/package/bootstrap-colorpicker