Skip to content

Commit

Permalink
fixes itsjavi#29 and closes itsjavi#26 :
Browse files Browse the repository at this point in the history
now setValue has been rewritten and changes both the component color and the input color,
removed .colorpicker selector confusion in docs
  • Loading branch information
Javier Aguilar committed Jul 19, 2013
1 parent 5ba06be commit 28bd8c7
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 92 deletions.
10 changes: 6 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ <h2>Example</h2>
<hr>
<h2>Using bootstrap-colorpicker.js</h2>
<p>Call the colopicker via javascript:</p>
<pre class="prettyprint linenums">$('.colorpicker').colorpicker()</pre>
<pre class="prettyprint linenums">$('.my-colorpicker-control').colorpicker()</pre>
<h3>Options</h3>
<table class="table table-bordered table-striped">
<thead>
Expand Down Expand Up @@ -128,14 +128,16 @@ <h4>.colorpicker(options)</h4>
<p>Initializes an colorpicker.</p>
<h4>.colorpicker('show')</h4>
<p>Show the color picker</p>
<h4>.colorpicker('update')</h4>
<p>Refreshes the widget colors (this is done automatically)</p>
<h4>.colorpicker('hide')</h4>
<p>Hide the color picker</p>
<h4>.colorpicker('place')</h4>
<p>Updates the color picker's position relative to the element</p>
<h4>.colorpicker('setValue', value)</h4>
<p>Set a new value for the color picker. Triggers 'changeColor' event.</p>
<h4>.colorpicker('destroy')</h4>
<p>Destroys the colorpicker widget and unbind all .colorpicker events from the element and component</p>
<h4>.colorpicker('setValue', value)</h4>
<p>Set a new value for the color picker (also for the input or component value). Triggers 'changeColor' event.</p>
<h3>Color object methods</h3>
<p>Each triggered events have a color object used internally by the picker. This object has several usefull methods.</p>
<h4>.setColor(value)</h4>
Expand Down Expand Up @@ -188,7 +190,7 @@ <h3>Events</h3>
</tbody>
</table>
<pre class="prettyprint linenums">
$(&#039;.colorpicker&#039;).colorpicker().on(&#039;changeColor&#039;, function(ev){
$(&#039;.my-colorpicker-control&#039;).colorpicker().on(&#039;changeColor&#039;, function(ev){
bodyStyle.backgroundColor = ev.color.toHex();
});
</pre>
Expand Down
Loading

0 comments on commit 28bd8c7

Please sign in to comment.