Skip to content

Commit c606075

Browse files
committed
Bug #61 Improved automatic formatting
1 parent 14b917c commit c606075

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/scripts/directive.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@
135135
}
136136
};
137137

138+
$scope.onBlur = function() {
139+
$scope.updateModel = true;
140+
$scope.update();
141+
};
138142

139143
$scope.initConfig = function() {
140144
$scope.config = {};

lib/scripts/template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ angular.module('color.picker').run(['$templateCache', function($templateCache) {
33
'<div class="color-picker-wrapper" ng-class="{\'color-picker-swatch-only\': config.swatchOnly}">\n' +
44
' <div class="color-picker-input-wrapper" ng-class="{\'input-group\': config.swatchBootstrap && config.swatch}">\n' +
55
' <span ng-if="config.swatchPos === \'left\'" class="color-picker-swatch" ng-click="focus()" ng-show="config.swatch" ng-class="{\'color-picker-swatch-left\': config.swatchPos !== \'right\', \'color-picker-swatch-right\': config.swatchPos === \'right\', \'input-group-addon\': config.swatchBootstrap}"></span>\n' +
6-
' <input class="color-picker-input form-control" type="text" ng-model="ngModel" ng-disabled="config.disabled" ng-change="onChange($event)" size="7" ng-focus="show()" ng-class="{\'color-picker-input-swatch\': config.swatch && !config.swatchOnly && config.swatchPos === \'left\'}">\n' +
6+
' <input class="color-picker-input form-control" type="text" ng-model="ngModel" ng-disabled="config.disabled" ng-blur="onBlur()" ng-change="onChange($event)" size="7" ng-focus="show()" ng-class="{\'color-picker-input-swatch\': config.swatch && !config.swatchOnly && config.swatchPos === \'left\'}">\n' +
77
' <span ng-if="config.swatchPos === \'right\'" class="color-picker-swatch" ng-click="focus()" ng-show="config.swatch" ng-class="{\'color-picker-swatch-left\': config.swatchPos !== \'right\', \'color-picker-swatch-right\': config.swatchPos === \'right\', \'input-group-addon\': config.swatchBootstrap}"></span>\n' +
88
' </div>\n' +
99
' <div class="color-picker-panel" ng-show="visible" ng-class="{\n' +

0 commit comments

Comments
 (0)