(js) Improve sgColorPicker directive

- replaced sg-on-select by ng-model;
- set button background (no more wrapping necessary).
This commit is contained in:
Francis Lachapelle
2015-10-15 15:10:37 -04:00
parent b02a4f82a0
commit ddf97ebb13
4 changed files with 31 additions and 33 deletions

View File

@@ -144,19 +144,17 @@
/**
* @ngInject
*/
PropertiesDialogController.$inject = ['$timeout', '$mdDialog', 'srcCalendar'];
function PropertiesDialogController($timeout, $mdDialog, srcCalendar) {
PropertiesDialogController.$inject = ['$scope', '$mdDialog', 'srcCalendar'];
function PropertiesDialogController($scope, $mdDialog, srcCalendar) {
var vm = this;
vm.calendar = new Calendar(srcCalendar.$omit());
vm.setColor = setColor;
vm.saveProperties = saveProperties;
vm.close = close;
function setColor(color) {
vm.calendar.color = color;
srcCalendar.color = color;
}
$scope.$watch('properties.calendar.color', function() {
srcCalendar.color = vm.calendar.color;
});
function saveProperties() {
vm.calendar.$save();