Skip to content

Commit

Permalink
Merge branch 'hotfix/v0.2.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
brianpkelley committed Apr 12, 2016
2 parents 8e8c963 + 2d60ed0 commit c0177ea
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 65 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "md-color-picker",
"version": "0.2.5",
"version": "0.2.6",
"authors": [
"Brian Kelley <[email protected]>"
],
Expand Down
21 changes: 6 additions & 15 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,34 +66,25 @@ <h4>*** Text Background ***</h4>
<h4>Text Style</h4>
<md-input-container>
<label>Font</label>
<md-select ng-model="font" aria-label="Font Family">
<md-option ng-repeat="font in fonts" ng-style="{'font-family':font}">{{font}}</md-option>
<md-select ng-model="textConfig.font" aria-label="Font Family">
<md-option ng-repeat="font in textConfig.fonts" ng-style="{'font-family':font}">{{font}}</md-option>
</md-select>
</md-input-container>
<div layout="row">
<div flex
md-color-picker
ng-model="textColor"
label="Text Color"
icon="format_color_text"

md-color-clear-button="false"
md-color-spectrum="false"
md-color-history="false"
></div>
<div md-color-picker ng-model="textConfig.textColor" md-color-preview></div>
</div>
<div layout="row">
<div flex
md-color-picker="backgroundOptions"
ng-model="textBackground"
md-color-picker="textConfig.backgroundOptions"
ng-model="textConfig.textBackground"
md-color-history="true"
></div>
</div>

<div>
<h5>Text Preview</h5>
<div class="md-color-picker-checkered-bg" layout="row" layout-align="center center">
<div class="text-preview" ng-style="{'background-color': textBackground, 'color': textColor, 'font-family': font}" style="width: 100%; height: 100%;" layout="row" layout-align="center center" layout-padding>
<div class="text-preview" ng-style="{'background-color': textConfig.textBackground, 'color': textConfig.textColor, 'font-family': textConfig.font}" style="width: 100%; height: 100%;" layout="row" layout-align="center center" layout-padding>
The five boxing wizards jump quickly.
</div>
</div>
Expand Down
14 changes: 8 additions & 6 deletions demo/js/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
var app = angular.module('plunker', ['ngMaterial','ngCookies', 'mdColorPicker']);

app.controller('MainCtrl', function($scope) {
$scope.fonts = [
$scope.textConfig = {};
$scope.textConfig.fonts = [
'Arial',
'Arial Black',
'Comic Sans MS',
Expand All @@ -13,11 +14,11 @@ app.controller('MainCtrl', function($scope) {
'Verdana'
];

$scope.font;
$scope.textColor;
$scope.textBackground;
$scope.textConfig.font;
$scope.textConfig.textColor;
$scope.textConfig.textBackground;

$scope.backgroundOptions = {
$scope.textConfig.backgroundOptions = {
label: "Text Background",
icon: "font_download",

Expand All @@ -29,6 +30,7 @@ app.controller('MainCtrl', function($scope) {
alphaChannel: false,
history: false,
defaultTab: 1
}
};
$scope.textConfig.showPreview = true;

});
2 changes: 1 addition & 1 deletion dist/mdColorPicker.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* md-color-picker - Angular-Material inspired color picker.
* @version v0.2.5
* @version v0.2.6
* @link https://github.com/brianpkelley/md-color-picker
* @license MIT
*/
Expand Down
33 changes: 14 additions & 19 deletions dist/mdColorPicker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* md-color-picker - Angular-Material inspired color picker.
* @version v0.2.5
* @version v0.2.6
* @link https://github.com/brianpkelley/md-color-picker
* @license MIT
*/
Expand Down Expand Up @@ -413,16 +413,16 @@ angular.module('mdColorPicker', [])
preserveScope: '@',

// Advanced options
mdColorClearButton: '=',
mdColorPreview: '=',

mdColorAlphaChannel: '=',
mdColorSpectrum: '=',
mdColorSliders: '=',
mdColorGenericPalette: '=',
mdColorMaterialPalette: '=',
mdColorHistory: '=',
mdColorDefaultTab: '@'
mdColorClearButton: '=?',
mdColorPreview: '=?',

mdColorAlphaChannel: '=?',
mdColorSpectrum: '=?',
mdColorSliders: '=?',
mdColorGenericPalette: '=?',
mdColorMaterialPalette: '=?',
mdColorHistory: '=?',
mdColorDefaultTab: '=?'
},
controller: ['$scope', '$element', '$attrs', '$mdDialog', '$mdColorPicker', function( $scope, $element, $attrs, $mdDialog, $mdColorPicker ) {
var didJustClose = false;
Expand All @@ -446,8 +446,6 @@ angular.module('mdColorPicker', [])
}
}

console.log( $scope );

// Get ngModelController from the current element
var ngModel = $element.controller('ngModel');

Expand Down Expand Up @@ -496,7 +494,7 @@ angular.module('mdColorPicker', [])
return;
}
// dateClick = Date.now();
console.log( "CLICK OPEN", dateClick, $scope );
// console.log( "CLICK OPEN", dateClick, $scope );

$mdColorPicker.show({
value: $scope.value,
Expand Down Expand Up @@ -547,10 +545,9 @@ angular.module('mdColorPicker', [])
mdColorDefaultTab: '='
},
controller: ["$scope", "$element", "$attrs", function( $scope, $element, $attrs ) {
console.log( "mdColorPickerContainer Controller", Date.now() - dateClick, $scope );
// console.log( "mdColorPickerContainer Controller", Date.now() - dateClick, $scope );

function getTabIndex( tab ) {
console.log( tab );
var index = 0;
if ( tab && typeof( tab ) === 'string' ) {
/* DOM isn't fast enough for this
Expand Down Expand Up @@ -660,7 +657,6 @@ angular.module('mdColorPicker', [])
}
};
$scope.setPaletteColor = function( event ) {
console.log( event.target.style.backgroundColor );
$timeout( function() {
$scope.color = tinycolor( event.target.style.backgroundColor );
});
Expand Down Expand Up @@ -723,7 +719,6 @@ angular.module('mdColorPicker', [])
link: function( scope, element, attrs ) {

var tabs = element[0].getElementsByTagName( 'md-tab' );
console.log( element, tabs.length );
/*
Replicating these structure without ng-repeats
Expand Down Expand Up @@ -848,7 +843,7 @@ angular.module('mdColorPicker', [])
if ( options === undefined ) {
options = {};
}
console.log( 'DIALOG OPTIONS', options );
//console.log( 'DIALOG OPTIONS', options );
// Defaults
// Dialog Properties
options.hasBackdrop = options.hasBackdrop === undefined ? true : options.hasBackdrop;
Expand Down
2 changes: 1 addition & 1 deletion dist/mdColorPicker.min.css

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

4 changes: 2 additions & 2 deletions dist/mdColorPicker.min.js

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@ gulp.task('js', function () {
.pipe(header(banner, { pkg : pkg } ))
.pipe(gulp.dest(paths.dist))
.pipe(rename({suffix: '.min'}))
.pipe(uglify())
.pipe(uglify({
"compress": {
"drop_console": !debug,
"drop_debugger": !debug
}
}))
.pipe(header(banner, { pkg : pkg } ))
.pipe(gulp.dest(paths.dist))
.pipe(livereload());
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "md-color-picker",
"version": "0.2.5",
"version": "0.2.6",
"description": "Angular-Material inspired color picker.",
"main": "dist/mdColorPicker.min.js",
"dependencies": {
Expand Down
31 changes: 13 additions & 18 deletions src/js/mdColorPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,16 +406,16 @@ angular.module('mdColorPicker', [])
preserveScope: '@',

// Advanced options
mdColorClearButton: '=',
mdColorPreview: '=',

mdColorAlphaChannel: '=',
mdColorSpectrum: '=',
mdColorSliders: '=',
mdColorGenericPalette: '=',
mdColorMaterialPalette: '=',
mdColorHistory: '=',
mdColorDefaultTab: '@'
mdColorClearButton: '=?',
mdColorPreview: '=?',

mdColorAlphaChannel: '=?',
mdColorSpectrum: '=?',
mdColorSliders: '=?',
mdColorGenericPalette: '=?',
mdColorMaterialPalette: '=?',
mdColorHistory: '=?',
mdColorDefaultTab: '=?'
},
controller: ['$scope', '$element', '$attrs', '$mdDialog', '$mdColorPicker', function( $scope, $element, $attrs, $mdDialog, $mdColorPicker ) {
var didJustClose = false;
Expand All @@ -439,8 +439,6 @@ angular.module('mdColorPicker', [])
}
}

console.log( $scope );

// Get ngModelController from the current element
var ngModel = $element.controller('ngModel');

Expand Down Expand Up @@ -489,7 +487,7 @@ angular.module('mdColorPicker', [])
return;
}
// dateClick = Date.now();
console.log( "CLICK OPEN", dateClick, $scope );
// console.log( "CLICK OPEN", dateClick, $scope );

$mdColorPicker.show({
value: $scope.value,
Expand Down Expand Up @@ -540,10 +538,9 @@ angular.module('mdColorPicker', [])
mdColorDefaultTab: '='
},
controller: function( $scope, $element, $attrs ) {
console.log( "mdColorPickerContainer Controller", Date.now() - dateClick, $scope );
// console.log( "mdColorPickerContainer Controller", Date.now() - dateClick, $scope );

function getTabIndex( tab ) {
console.log( tab );
var index = 0;
if ( tab && typeof( tab ) === 'string' ) {
/* DOM isn't fast enough for this
Expand Down Expand Up @@ -653,7 +650,6 @@ angular.module('mdColorPicker', [])
}
};
$scope.setPaletteColor = function( event ) {
console.log( event.target.style.backgroundColor );
$timeout( function() {
$scope.color = tinycolor( event.target.style.backgroundColor );
});
Expand Down Expand Up @@ -716,7 +712,6 @@ angular.module('mdColorPicker', [])
link: function( scope, element, attrs ) {

var tabs = element[0].getElementsByTagName( 'md-tab' );
console.log( element, tabs.length );
/*
Replicating these structure without ng-repeats
Expand Down Expand Up @@ -841,7 +836,7 @@ angular.module('mdColorPicker', [])
if ( options === undefined ) {
options = {};
}
console.log( 'DIALOG OPTIONS', options );
//console.log( 'DIALOG OPTIONS', options );
// Defaults
// Dialog Properties
options.hasBackdrop = options.hasBackdrop === undefined ? true : options.hasBackdrop;
Expand Down

0 comments on commit c0177ea

Please sign in to comment.