Skip to content

Commit

Permalink
Store picker value
Browse files Browse the repository at this point in the history
  • Loading branch information
buberdds committed Apr 3, 2017
1 parent 4770f1d commit 5509da9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-bootstrap-colorpicker",
"version": "3.0.25",
"version": "3.0.26",
"main": [
"js/bootstrap-colorpicker-module.js",
"css/colorpicker.css"
Expand Down
2 changes: 1 addition & 1 deletion css/colorpicker.min.css

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions js/bootstrap-colorpicker-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,12 @@ angular.module('colorpicker.module', [])
'</div>',
colorpickerTemplate = angular.element(template),
pickerColor = Color,
componentSizePx,
colorpickerValue = {
h: 1,
s: 1,
b: 1,
a: 1
},
sliderAlpha,
sliderHue = colorpickerTemplate.find('colorpicker-hue'),
sliderSaturation = colorpickerTemplate.find('colorpicker-saturation'),
Expand Down Expand Up @@ -413,7 +418,7 @@ angular.module('colorpicker.module', [])
}

function mousemove(event) {
var
var
left = Slider.getLeftPosition(event),
top = Slider.getTopPosition(event),
slider = Slider.getSlider();
Expand Down Expand Up @@ -445,6 +450,7 @@ angular.module('colorpicker.module', [])
}

function update(omitInnerInput) {
pickerColor.value = colorpickerValue;
pickerColor.setColor(elem.val());
if (withInput && !omitInnerInput) {
pickerColorInput.val(elem.val());
Expand All @@ -455,6 +461,7 @@ angular.module('colorpicker.module', [])
});
pickerColorPointers.eq(1).css('top', componentSize * (1 - pickerColor.value.h) + 'px');
pickerColorPointers.eq(2).css('top', componentSize * (1 - pickerColor.value.a) + 'px');
colorpickerValue = pickerColor.value;
previewColor();
}

Expand Down
2 changes: 1 addition & 1 deletion js/bootstrap-colorpicker-module.min.js

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-bootstrap-colorpicker",
"version": "3.0.25",
"version": "3.0.26",
"description": "Native AngularJS colorpicker directive",
"main": "js/bootstrap-colorpicker-module.js",
"directories": {
Expand Down

0 comments on commit 5509da9

Please sign in to comment.