Skip to content

Commit

Permalink
Merge branch 'release/v1.1.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
recurser committed Apr 7, 2013
2 parents 1120ffc + 007032b commit affe6a0
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 21 deletions.
9 changes: 5 additions & 4 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ colorCodeColor: Text color of the color code inside the button. Only
used if 'displayColorCode' is true.
default value: '#FFF'

callback: Function to be called when a color is selected. The
onSelect: Function to be called when a color is selected. The
hex code is passed into the function.
default value: null

Expand Down Expand Up @@ -170,10 +170,11 @@ Total time: 2 seconds
Change history
-----------

* **Version 1.1.2 (2013-04-06)** : Add onCellEnter, onClose and livePreview options (thanks [jbergen](https://github.com/jbergen)).
* **Version 1.1.1 (2013-03-29)** : Add callback option (thanks [jbergen](https://github.com/jbergen)).
* **Version 1.1.3 (2013-04-07)** : Rename *callback* option to *onSelect*.
* **Version 1.1.2 (2013-04-06)** : Add *onCellEnter*, *onClose* and *livePreview* options (thanks [jbergen](https://github.com/jbergen)).
* **Version 1.1.1 (2013-03-29)** : Add *callback* option (thanks [jbergen](https://github.com/jbergen)).
* **Version 1.1.0 (2012-10-14)** : Remove select and cancel buttons (thanks [wesnolte](https://github.com/wesnolte)).
* **Version 1.0.1 (2011-08-15)** : Trigger change() event when a color is selected (thanks [firstclown](https://github.com/firstclown)), and make colored display box clickable to select colors.
* **Version 1.0.1 (2011-08-15)** : Trigger *change()* event when a color is selected (thanks [firstclown](https://github.com/firstclown)), and make colored display box clickable to select colors.
* **Version 1.0.0 (2011-05-21)** : 1.0 release.


Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.2
1.1.3
7 changes: 5 additions & 2 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
$('.simple_color_live_preview').simpleColor({ livePreview: true });

$('.simple_color_callback').simpleColor({
callback: function( hex ) {
onSelect: function( hex ) {
alert("You selected #" + hex);
}
});
Expand All @@ -35,7 +35,7 @@
buttonClass: 'button',
displayColorCode: true,
livePreview: true,
callback: function( hex ) {
onSelect: function( hex ) {
alert("You selected #" + hex);
},
onCellEnter: function( hex ) {
Expand All @@ -58,6 +58,9 @@
font-family: Helvetica;
margin: 10px 0;
}
.simpleColorChooser {
background-color: #fff;
}

.button {
clear: right;
Expand Down
12 changes: 6 additions & 6 deletions jquery.simple-color.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*
* Version: 1.1.2 (201304062015)
* Version: 1.1.3 (201304080141)
*/
(function($) {
/**
Expand Down Expand Up @@ -54,7 +54,7 @@
* colorCodeColor: Text color of the color code inside the button. Only used if 'displayColorCode' is true.
* Default value: '#FFF'
*
* callback: Callback function to call after a color has been chosen.
* onSelect: Callback function to call after a color has been chosen.
* Default value: null
* Returns: hex value
*
Expand Down Expand Up @@ -118,7 +118,7 @@
displayColorCode: this.attr('displayColorCode') || false,
colorCodeAlign: this.attr('colorCodeAlign') || 'center',
colorCodeColor: this.attr('colorCodeColor') || '#FFF',
callback: null,
onSelect: null,
onCellEnter: null,
onClose: null,
livePreview: false
Expand Down Expand Up @@ -262,9 +262,9 @@
if (options.displayColorCode) {
event.data.display_box.text('#' + this.id);
}
// If a callback function is defined then excecute it.
if (options.callback) {
options.callback(this.id);
// If an onSelect callback function is defined then excecute it.
if (options.onSelect) {
options.onSelect(this.id);
}

});
Expand Down
6 changes: 3 additions & 3 deletions jquery.simple-color.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/jquery.simple-color.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
* colorCodeColor: Text color of the color code inside the button. Only used if 'displayColorCode' is true.
* Default value: '#FFF'
*
* callback: Callback function to call after a color has been chosen.
* onSelect: Callback function to call after a color has been chosen.
* Default value: null
* Returns: hex value
*
Expand Down Expand Up @@ -118,7 +118,7 @@
displayColorCode: this.attr('displayColorCode') || false,
colorCodeAlign: this.attr('colorCodeAlign') || 'center',
colorCodeColor: this.attr('colorCodeColor') || '#FFF',
callback: null,
onSelect: null,
onCellEnter: null,
onClose: null,
livePreview: false
Expand Down Expand Up @@ -262,9 +262,9 @@
if (options.displayColorCode) {
event.data.display_box.text('#' + this.id);
}
// If a callback function is defined then excecute it.
if (options.callback) {
options.callback(this.id);
// If an onSelect callback function is defined then excecute it.
if (options.onSelect) {
options.onSelect(this.id);
}

});
Expand Down

0 comments on commit affe6a0

Please sign in to comment.