Skip to content

Commit c479274

Browse files
committed
Bumping to v2.4.0
1 parent f952ca9 commit c479274

9 files changed

+62
-53
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ $scope.eventApi = {
119119
onDestroy: function(api, color) {},
120120
};
121121

122-
// decorator
122+
// decorator - all variables in options can be globally overridden here
123123
angular
124124
.module('app', ['color.picker'])
125125
.config(function($provide) {

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular-color-picker",
33
"description": "Color Picker Directive For AngularJS",
4-
"version": "2.3.0",
4+
"version": "2.4.0",
55
"homepage": "https://github.com/ruhley/angular-color-picker",
66
"repository": {
77
"type": "git",

dist/angularjs-color-picker.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angularjs-color-picker.js

Lines changed: 48 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
/*!
2-
* angularjs-color-picker v2.3.0
2+
* angularjs-color-picker v2.4.0
33
* https://github.com/ruhley/angular-color-picker/
44
*
55
* Copyright 2016 ruhley
66
*
7-
* 2016-07-29 09:30:27
7+
* 2016-08-05 08:32:24
88
*
99
*/
1010

1111
(function (global, factory) {
12-
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
13-
typeof define === 'function' && define.amd ? define(factory) :
14-
(global.AngularjsColorPicker = factory());
15-
}(this, function () { 'use strict';
12+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('tinycolor2')) :
13+
typeof define === 'function' && define.amd ? define(['tinycolor2'], factory) :
14+
(global.AngularjsColorPicker = factory(global.tinycolor));
15+
}(this, function (tinycolor) { 'use strict';
16+
17+
tinycolor = 'default' in tinycolor ? tinycolor['default'] : tinycolor;
1618

1719
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
1820
return typeof obj;
@@ -45,14 +47,15 @@
4547
}();
4648

4749
var AngularColorPickerController = function () {
48-
function AngularColorPickerController(_$scope, _$element, _$document, _$timeout) {
50+
function AngularColorPickerController(_$scope, _$element, _$document, _$timeout, _ColorPickerOptions) {
4951
classCallCheck(this, AngularColorPickerController);
5052

5153
// set angular injected variables
5254
this.$scope = _$scope;
5355
this.$element = _$element;
5456
this.$document = _$document;
5557
this.$timeout = _$timeout;
58+
this.ColorPickerOptions = _ColorPickerOptions;
5659

5760
this.$scope.init = this.init.bind(this);
5861

@@ -415,36 +418,7 @@
415418
}, {
416419
key: 'initConfig',
417420
value: function initConfig() {
418-
this.options = this.merge(this.options, {
419-
disabled: false,
420-
hue: true,
421-
alpha: true,
422-
round: false,
423-
case: 'upper',
424-
format: 'hsl',
425-
pos: 'bottom left',
426-
swatch: true,
427-
swatchOnly: false,
428-
swatchPos: 'left',
429-
swatchBootstrap: true,
430-
inline: false,
431-
placeholder: '',
432-
close: {
433-
show: false,
434-
label: 'Close',
435-
class: ''
436-
},
437-
clear: {
438-
show: false,
439-
label: 'Clear',
440-
class: ''
441-
},
442-
reset: {
443-
show: false,
444-
label: 'Reset',
445-
class: ''
446-
}
447-
});
421+
this.options = this.merge(this.options, this.ColorPickerOptions);
448422

449423
this.visible = this.options.inline;
450424

@@ -944,7 +918,7 @@
944918
return AngularColorPickerController;
945919
}();
946920

947-
AngularColorPickerController.$inject = ['$scope', '$element', '$document', '$timeout'];
921+
AngularColorPickerController.$inject = ['$scope', '$element', '$document', '$timeout', 'ColorPickerOptions'];
948922

949923
function colorPickerDirective() {
950924
return {
@@ -973,7 +947,42 @@
973947

974948
template.$inject = ['$templateCache'];
975949

976-
var colorPicker = angular.module('color.picker', []).directive('colorPicker', colorPickerDirective).run(template);
950+
var AngularColorPickerOptions = function AngularColorPickerOptions() {
951+
classCallCheck(this, AngularColorPickerOptions);
952+
953+
return {
954+
disabled: false,
955+
hue: true,
956+
alpha: true,
957+
round: false,
958+
case: 'upper',
959+
format: 'hsl',
960+
pos: 'bottom left',
961+
swatch: true,
962+
swatchOnly: false,
963+
swatchPos: 'left',
964+
swatchBootstrap: true,
965+
inline: false,
966+
placeholder: '',
967+
close: {
968+
show: false,
969+
label: 'Close',
970+
class: ''
971+
},
972+
clear: {
973+
show: false,
974+
label: 'Clear',
975+
class: ''
976+
},
977+
reset: {
978+
show: false,
979+
label: 'Reset',
980+
class: ''
981+
}
982+
};
983+
};
984+
985+
var colorPicker = angular.module('color.picker', []).service('ColorPickerOptions', AngularColorPickerOptions).directive('colorPicker', colorPickerDirective).run(template);
977986

978987
return colorPicker;
979988

dist/angularjs-color-picker.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angularjs-color-picker.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/themes/angularjs-color-picker-bootstrap.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/*!
2-
* angularjs-color-picker v2.3.0
2+
* angularjs-color-picker v2.4.0
33
* https://github.com/ruhley/angular-color-picker/
44
*
55
* Copyright 2016 ruhley
66
*
7-
* 2016-07-29 09:30:30
7+
* 2016-08-05 08:32:27
88
*
99
*/
1010
.color-picker-wrapper .color-picker-input-wrapper {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*!
2-
* angularjs-color-picker v2.3.0
2+
* angularjs-color-picker v2.4.0
33
* https://github.com/ruhley/angular-color-picker/
44
*
55
* Copyright 2016 ruhley
66
*
7-
* 2016-07-29 09:30:30
7+
* 2016-08-05 08:32:27
88
*
99
*/.color-picker-wrapper .color-picker-input-wrapper{width:100%}.color-picker-wrapper .color-picker-swatch:not(.input-group-addon){height:28px}.color-picker-wrapper.color-picker-swatch-only .input-group .input-group-addon{border-radius:4px}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angularjs-color-picker",
33
"description": "Color Picker Directive For AngularJS",
4-
"version": "2.3.0",
4+
"version": "2.4.0",
55
"license": "MIT",
66
"main": "dist/angularjs-color-picker.min.js",
77
"dependencies": {

0 commit comments

Comments
 (0)