-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
91 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...dSettings.Web/App_Plugins/Our.Umbraco.GridSettings/editors/ClassColorPicker/controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
(function () { | ||
'use strict'; | ||
|
||
var controller = function ($scope, notificationsService) { | ||
$scope.colors = []; | ||
var stringPreValues = $scope.model.prevalues.filter(function (item) { return typeof (item) === 'string'; }); | ||
|
||
if (stringPreValues.length > 0) { | ||
notificationsService.error("Configuration Error", "Class Color Picker (" + $scope.model.label + ") must only have key value pair prevalues."); | ||
} else { | ||
$scope.colors = $scope.model.prevalues; | ||
} | ||
|
||
$scope.setValue = function (value) { | ||
$scope.model.value = value; | ||
} | ||
|
||
$scope.isValue = function (value) { | ||
return value === $scope.model.value; | ||
} | ||
}; | ||
|
||
angular.module("umbraco").controller("Our.Umbraco.GridSettings.ClassColorPickerController", controller); | ||
})(); |
9 changes: 9 additions & 0 deletions
9
....GridSettings.Web/App_Plugins/Our.Umbraco.GridSettings/editors/ClassColorPicker/view.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<div ng-controller="Our.Umbraco.GridSettings.ClassColorPickerController"> | ||
<ul class="thumbnails color-picker"> | ||
<li ng-repeat="item in colors" ng-class="{active: isValue(item.value)}" title="{{item.value}}"> | ||
<a ng-click="setValue(item.value)" class="thumbnail" hex-bg-color="{{item.label}}"> | ||
<!-- --> | ||
</a> | ||
</li> | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters