wcolorpicker-rails 1.2.4 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +1 -1
- data/lib/wcolorpicker-rails/version.rb +1 -1
- data/vendor/assets/javascripts/wcolorpicker.js +9 -8
- metadata +2 -2
data/README.md
CHANGED
@@ -9,7 +9,7 @@ For info on how to use the plugin see the original documentation:
|
|
9
9
|
|
10
10
|
Praise for creating this tool should of course be directed at [Websanova](http://www.websanova.com/)!
|
11
11
|
|
12
|
-
For the orignal javascript and css
|
12
|
+
For the orignal javascript and css files go to their [Github repository](https://github.com/websanova/wColorPicker).
|
13
13
|
|
14
14
|
## Usage
|
15
15
|
|
@@ -5,10 +5,10 @@
|
|
5
5
|
*
|
6
6
|
* @author Websanova
|
7
7
|
* @copyright Copyright (c) 2012 Websanova.
|
8
|
-
* @license This
|
8
|
+
* @license This wChar jQuery plug-in is dual licensed under the MIT and GPL licenses.
|
9
9
|
* @link http://www.websanova.com
|
10
|
-
* @
|
11
|
-
* @version Version 1.
|
10
|
+
* @github http://github.com/websanova/wColorPicker
|
11
|
+
* @version Version 1.3.0
|
12
12
|
*
|
13
13
|
******************************************/
|
14
14
|
(function($)
|
@@ -49,7 +49,7 @@
|
|
49
49
|
var elem = $(this);
|
50
50
|
var $settings = jQuery.extend(true, {}, settings);
|
51
51
|
|
52
|
-
var cp = new ColorPicker($settings);
|
52
|
+
var cp = new ColorPicker($settings, elem);
|
53
53
|
|
54
54
|
cp.generate();
|
55
55
|
|
@@ -78,10 +78,11 @@
|
|
78
78
|
/**
|
79
79
|
* ColorPicker class definition
|
80
80
|
*/
|
81
|
-
function ColorPicker(settings)
|
81
|
+
function ColorPicker(settings, elem)
|
82
82
|
{
|
83
83
|
this.colorPicker = null;
|
84
84
|
this.settings = settings;
|
85
|
+
this.$elem = elem;
|
85
86
|
this.currentColor = settings.initColor;
|
86
87
|
|
87
88
|
this.height = null; // init this, need to get height/width proper while element is still showing
|
@@ -217,7 +218,7 @@
|
|
217
218
|
$this.currentColor = color;
|
218
219
|
$this.customInput.val(color);
|
219
220
|
|
220
|
-
if($this.settings.onSelect) $this.settings.onSelect(color);
|
221
|
+
if($this.settings.onSelect) $this.settings.onSelect.apply(this, [color]);
|
221
222
|
|
222
223
|
if($this.buttonColor)
|
223
224
|
{
|
@@ -237,7 +238,7 @@
|
|
237
238
|
$this.customTarget.css('backgroundColor', color);
|
238
239
|
$this.customInput.val(color);
|
239
240
|
|
240
|
-
if($this.settings.onMouseover) $this.settings.onMouseover(color);
|
241
|
+
if($this.settings.onMouseover) $this.settings.onMouseover.apply(this, [color]);
|
241
242
|
},
|
242
243
|
|
243
244
|
colorHoverOff: function($this, $element)
|
@@ -248,7 +249,7 @@
|
|
248
249
|
$this.customTarget.css('backgroundColor', $this.currentColor);
|
249
250
|
$this.customInput.val($this.currentColor);
|
250
251
|
|
251
|
-
if($this.settings.onMouseout) $this.settings.onMouseout($this.currentColor);
|
252
|
+
if($this.settings.onMouseout) $this.settings.onMouseout.apply(this, [$this.currentColor]);
|
252
253
|
},
|
253
254
|
|
254
255
|
appendToElement: function($element)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wcolorpicker-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-23 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: This gem Provides the Websanova Color Picker assets for your Rails application
|
15
15
|
.
|