Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
function EditorThemeColorPickerController($scope,localizationService, contentResource){
var contentId;
//Figure out whether we're working locally or live...surely this can be done a better way? But does not seem that it's possible to lookup aliases using the API's currently :-/
if(location.hostname.indexOf('localhost') === 0){
contentId = 1920;
} else{
contentId = 2123;
//Setup array to hold color themes
$scope.colorThemes = []
//Get colors
var colorItems = contentArray.items;
for (var i = 0; i < colorItems.length; i++) {
var colorItem = colorItems[i],
colorTheme =[0].value;
//Let's initialize the model with a default value
var colorThemeObj = {
backgroundColor: $scope.colorThemes[0].backgroundColor,
textColor: $scope.colorThemes[0].textColor,
isDefault: true,
$scope.model.value = colorThemeObj;
$scope.selectTheme = function(idx){
$scope.model.value.backgroundColor = $scope.colorThemes[idx].backgroundColor;
$scope.model.value.textColor = $scope.colorThemes[idx].textColor;
$scope.model.value.isDefault = true;
$ = idx;
//Inject the controller into the umbraco context
angular.module("umbraco").controller("Our.Umbraco.EditorThemeColorPickerController", EditorThemeColorPickerController);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment