From 6c32bb51d064e499db5e7bc6f4be23ec72e321a1 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Mon, 2 Mar 2020 15:37:20 +0000 Subject: [PATCH] Added TODO notes to replace AngularJS functions This, in part, is due to an Umbraco issue about reliance on AngularJS functions, and the effort involved in future decoupling. https://github.com/umbraco/Umbraco-CMS/issues/7718 https://trello.com/b/wiDsUbly/umbracos-angularjs-divorce By getting into the mindset of agnostic JS functions (where applicable), the code will (hopefully) be more portable (migratable). --- .../DataEditors/Buttons/buttons.js | 4 ++-- .../DataEditors/Cards/cards.js | 6 +++--- .../CascadingDropdownList/cascading-dropdown-list.js | 2 +- .../DataEditors/Checkbox/checkbox.js | 2 +- .../DataEditors/CheckboxList/checkbox-list.js | 4 ++-- .../DataEditors/CodeEditor/code-editor.js | 2 +- .../ConfigurationEditor/configuration-editor.inline.js | 4 ++-- .../DataEditors/ConfigurationEditor/configuration-editor.js | 2 +- .../ConfigurationEditor/configuration-editor.overlay.js | 6 +++--- .../DataEditors/ContentBlocks/content-blocks.js | 4 ++-- .../DataEditors/ContentBlocks/content-blocks.overlay.js | 6 +++--- .../DataEditors/DataTable/data-table.js | 6 +++--- .../DataEditors/DropdownList/dropdown-list.js | 4 ++-- .../DataEditors/IconPicker/icon-picker.js | 2 +- .../DataEditors/ItemPicker/item-picker.js | 6 +++--- .../DataEditors/ItemPicker/item-picker.overlay.js | 2 +- .../DataEditors/MacroPicker/macro-picker.js | 2 +- .../DataEditors/RadioButtonList/radio-button-list.js | 4 ++-- .../DataEditors/RenderMacro/render-macro.js | 2 +- .../DataEditors/TextInput/text-input.js | 2 +- .../DataEditors/Toggles/toggles.js | 4 ++-- .../DataEditors/_/_dev-mode.js | 4 ++-- 22 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/Umbraco.Community.Contentment/DataEditors/Buttons/buttons.js b/src/Umbraco.Community.Contentment/DataEditors/Buttons/buttons.js index a2374fd3..d5e0249c 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/Buttons/buttons.js +++ b/src/Umbraco.Community.Contentment/DataEditors/Buttons/buttons.js @@ -15,7 +15,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. items: [], enableMultiple: 0 }; - var config = angular.extend({}, defaultConfig, $scope.model.config); + var config = angular.extend({}, defaultConfig, $scope.model.config); // TODO: Replace AngularJS dependency. [LK:2020-03-02] var vm = this; @@ -33,7 +33,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. $scope.model.value.splice(1); } - vm.items = angular.copy(config.items); + vm.items = angular.copy(config.items); // TODO: Replace AngularJS dependency. [LK:2020-03-02] _.each(vm.items, function (item) { item.selected = _.contains($scope.model.value, item.value); diff --git a/src/Umbraco.Community.Contentment/DataEditors/Cards/cards.js b/src/Umbraco.Community.Contentment/DataEditors/Cards/cards.js index 752e8268..458622f9 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/Cards/cards.js +++ b/src/Umbraco.Community.Contentment/DataEditors/Cards/cards.js @@ -24,7 +24,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. overlayOrderBy: "name", enableDevMode: 0, }; - var config = angular.extend({}, defaultConfig, $scope.model.config); + var config = angular.extend({}, defaultConfig, $scope.model.config); // TODO: Replace AngularJS dependency. [LK:2020-03-02] var vm = this; @@ -96,7 +96,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. submit: function (selectedItems) { _.each(selectedItems, function (x) { - vm.items.push(angular.copy(x)); + vm.items.push(angular.copy(x)); // TODO: Replace AngularJS dependency. [LK:2020-03-02] $scope.model.value.push(x.value); }); @@ -126,7 +126,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. _.each($scope.model.value, function (v) { var item = _.find(config.items, function (x) { return x.value === v }); if (item) { - vm.items.push(angular.copy(item)); + vm.items.push(angular.copy(item)); // TODO: Replace AngularJS dependency. [LK:2020-03-02] } else { orphaned.push(v); } diff --git a/src/Umbraco.Community.Contentment/DataEditors/CascadingDropdownList/cascading-dropdown-list.js b/src/Umbraco.Community.Contentment/DataEditors/CascadingDropdownList/cascading-dropdown-list.js index 49fcec6f..f19a270f 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/CascadingDropdownList/cascading-dropdown-list.js +++ b/src/Umbraco.Community.Contentment/DataEditors/CascadingDropdownList/cascading-dropdown-list.js @@ -20,7 +20,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. apis: [], defaultValue: [""] }; - var config = angular.extend({}, defaultConfig, $scope.model.config); + var config = angular.extend({}, defaultConfig, $scope.model.config); // TODO: Replace AngularJS dependency. [LK:2020-03-02] var vm = this; diff --git a/src/Umbraco.Community.Contentment/DataEditors/Checkbox/checkbox.js b/src/Umbraco.Community.Contentment/DataEditors/Checkbox/checkbox.js index c695d97f..5c79d5e7 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/Checkbox/checkbox.js +++ b/src/Umbraco.Community.Contentment/DataEditors/Checkbox/checkbox.js @@ -10,7 +10,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. //console.log("checkbox.model", $scope.model); var defaultConfig = { showInline: 0, defaultValue: 0 }; - var config = angular.extend({}, defaultConfig, $scope.model.config); + var config = angular.extend({}, defaultConfig, $scope.model.config); // TODO: Replace AngularJS dependency. [LK:2020-03-02] var vm = this; diff --git a/src/Umbraco.Community.Contentment/DataEditors/CheckboxList/checkbox-list.js b/src/Umbraco.Community.Contentment/DataEditors/CheckboxList/checkbox-list.js index a11c909e..c88a46d1 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/CheckboxList/checkbox-list.js +++ b/src/Umbraco.Community.Contentment/DataEditors/CheckboxList/checkbox-list.js @@ -16,7 +16,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. showIcons: 0, defaultValue: [] }; - var config = angular.extend({}, defaultConfig, $scope.model.config); + var config = angular.extend({}, defaultConfig, $scope.model.config); // TODO: Replace AngularJS dependency. [LK:2020-03-02] var vm = this; @@ -27,7 +27,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. $scope.model.value = [$scope.model.value]; } - vm.items = angular.copy(config.items); + vm.items = angular.copy(config.items); // TODO: Replace AngularJS dependency. [LK:2020-03-02] _.each(vm.items, function (item) { item.checked = _.contains($scope.model.value, item.value); diff --git a/src/Umbraco.Community.Contentment/DataEditors/CodeEditor/code-editor.js b/src/Umbraco.Community.Contentment/DataEditors/CodeEditor/code-editor.js index 217a8a34..57fa0b89 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/CodeEditor/code-editor.js +++ b/src/Umbraco.Community.Contentment/DataEditors/CodeEditor/code-editor.js @@ -26,7 +26,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. enableLiveAutocompletion: 0, readonly: 0, }; - var config = angular.extend({}, defaultConfig, $scope.model.config); + var config = angular.extend({}, defaultConfig, $scope.model.config); // TODO: Replace AngularJS dependency. [LK:2020-03-02] var vm = this; diff --git a/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/configuration-editor.inline.js b/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/configuration-editor.inline.js index 49dd98fe..8b997bf4 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/configuration-editor.inline.js +++ b/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/configuration-editor.inline.js @@ -13,13 +13,13 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. var defaultConfig = { editor: {} }; - var config = angular.extend({}, defaultConfig, $scope.model.config); + var config = angular.extend({}, defaultConfig, $scope.model.config); // TODO: Replace AngularJS dependency. [LK:2020-03-02] var vm = this; function init() { - vm.editor = angular.copy(config.editor); + vm.editor = angular.copy(config.editor); // TODO: Replace AngularJS dependency. [LK:2020-03-02] $scope.model.value = $scope.model.value || { type: vm.editor.type, value: vm.editor.defaultValues || {} }; diff --git a/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/configuration-editor.js b/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/configuration-editor.js index b3ba1ddf..3c76e057 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/configuration-editor.js +++ b/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/configuration-editor.js @@ -26,7 +26,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. overlayView: "", enableDevMode: 0, }; - var config = angular.extend({}, defaultConfig, $scope.model.config); + var config = angular.extend({}, defaultConfig, $scope.model.config); // TODO: Replace AngularJS dependency. [LK:2020-03-02] var vm = this; diff --git a/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/configuration-editor.overlay.js b/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/configuration-editor.overlay.js index b4403bef..a7e71924 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/configuration-editor.overlay.js +++ b/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/configuration-editor.overlay.js @@ -20,7 +20,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.Overlays.Con enableFilter: false, orderBy: "name" }; - var config = angular.extend({}, defaultConfig, $scope.model.config); + var config = angular.extend({}, defaultConfig, $scope.model.config); // TODO: Replace AngularJS dependency. [LK:2020-03-02] var vm = this; @@ -62,7 +62,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.Overlays.Con } vm.title = "Configure " + editor.name; - vm.editor = angular.copy(editor); + vm.editor = angular.copy(editor); // TODO: Replace AngularJS dependency. [LK:2020-03-02] if (vm.editor.fields && vm.editor.fields.length > 0) { _.each(vm.editor.fields, function (x) { @@ -96,7 +96,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.Overlays.Con // https://github.com/umbraco/Umbraco-CMS/blob/release-8.1.0/src/Umbraco.Web.UI.Client/src/common/services/formhelper.service.js#L26 $scope.$broadcast("formSubmitting", { scope: $scope }); - var obj = angular.extend({ value: {} }, item); + var obj = angular.extend({ value: {} }, item); // TODO: Replace AngularJS dependency. [LK:2020-03-02] _.each(item.fields, function (x) { obj.value[x.key] = x.value; diff --git a/src/Umbraco.Community.Contentment/DataEditors/ContentBlocks/content-blocks.js b/src/Umbraco.Community.Contentment/DataEditors/ContentBlocks/content-blocks.js index 0e997598..e2f0a550 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/ContentBlocks/content-blocks.js +++ b/src/Umbraco.Community.Contentment/DataEditors/ContentBlocks/content-blocks.js @@ -28,7 +28,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. overlayView: "", enableDevMode: 0, }; - var config = angular.extend({}, defaultConfig, $scope.model.config); + var config = angular.extend({}, defaultConfig, $scope.model.config); // TODO: Replace AngularJS dependency. [LK:2020-03-02] var vm = this; @@ -296,7 +296,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. expireDate: null, releaseDate: null, templateAlias: null, - variants: [angular.extend({ save: true }, variant)] + variants: [angular.extend({ save: true }, variant)] // TODO: Replace AngularJS dependency. [LK:2020-03-02] }; contentResource diff --git a/src/Umbraco.Community.Contentment/DataEditors/ContentBlocks/content-blocks.overlay.js b/src/Umbraco.Community.Contentment/DataEditors/ContentBlocks/content-blocks.overlay.js index ede72d90..3716d853 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/ContentBlocks/content-blocks.overlay.js +++ b/src/Umbraco.Community.Contentment/DataEditors/ContentBlocks/content-blocks.overlay.js @@ -17,7 +17,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.Overlays.Con elementTypes: [], enableFilter: true, }; - var config = angular.extend({}, defaultConfig, $scope.model.config); + var config = angular.extend({}, defaultConfig, $scope.model.config); // TODO: Replace AngularJS dependency. [LK:2020-03-02] var vm = this; @@ -112,7 +112,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.Overlays.Con : contentResource.getScaffold(-2, elementType.alias); getScaffold.then(function (data) { - angular.extend(vm.content, data.variants[0]); + angular.extend(vm.content, data.variants[0]); // TODO: Replace AngularJS dependency. [LK:2020-03-02] vm.loading = false; }); @@ -158,7 +158,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.Overlays.Con } } - angular.extend(vm.content, data.variants[0]); + angular.extend(vm.content, data.variants[0]); // TODO: Replace AngularJS dependency. [LK:2020-03-02] vm.loading = false; }); diff --git a/src/Umbraco.Community.Contentment/DataEditors/DataTable/data-table.js b/src/Umbraco.Community.Contentment/DataEditors/DataTable/data-table.js index 7c24c28f..5169f8e3 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/DataTable/data-table.js +++ b/src/Umbraco.Community.Contentment/DataEditors/DataTable/data-table.js @@ -10,7 +10,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. // console.log("datatable.model", $scope.model); var defaultConfig = { fields: [], disableSorting: 0, maxItems: 0, restrictWidth: 0, usePrevalueEditors: 1 }; - var config = angular.extend({}, defaultConfig, $scope.model.config); + var config = angular.extend({}, defaultConfig, $scope.model.config); // TODO: Replace AngularJS dependency. [LK:2020-03-02] var vm = this; @@ -22,7 +22,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. vm.items = []; _.each($scope.model.value, function (value, row) { - var fields = angular.copy(config.fields); + var fields = angular.copy(config.fields); // TODO: Replace AngularJS dependency. [LK:2020-03-02] _.each(fields, function (field, cell) { field.alias = [$scope.model.alias, row, cell].join("_"); @@ -72,7 +72,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. }; function add() { - vm.items.push(angular.copy(config.fields)); + vm.items.push(angular.copy(config.fields)); // TODO: Replace AngularJS dependency. [LK:2020-03-02] if ((config.maxItems !== 0 && config.maxItems !== "0") && vm.items.length >= config.maxItems) { vm.allowAdd = false; diff --git a/src/Umbraco.Community.Contentment/DataEditors/DropdownList/dropdown-list.js b/src/Umbraco.Community.Contentment/DataEditors/DropdownList/dropdown-list.js index 3ce285aa..c2af72e3 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/DropdownList/dropdown-list.js +++ b/src/Umbraco.Community.Contentment/DataEditors/DropdownList/dropdown-list.js @@ -15,7 +15,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. defaultValue: "", htmlAttributes: [] }; - var config = angular.extend({}, defaultConfig, $scope.model.config); + var config = angular.extend({}, defaultConfig, $scope.model.config); // TODO: Replace AngularJS dependency. [LK:2020-03-02] var vm = this; @@ -26,7 +26,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. $scope.model.value = _.first($scope.model.value); } - vm.items = angular.copy(config.items); + vm.items = angular.copy(config.items); // TODO: Replace AngularJS dependency. [LK:2020-03-02] vm.allowEmpty = Object.toBoolean(config.allowEmpty); diff --git a/src/Umbraco.Community.Contentment/DataEditors/IconPicker/icon-picker.js b/src/Umbraco.Community.Contentment/DataEditors/IconPicker/icon-picker.js index fac3565d..f58b82df 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/IconPicker/icon-picker.js +++ b/src/Umbraco.Community.Contentment/DataEditors/IconPicker/icon-picker.js @@ -11,7 +11,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. // console.log("icon-picker.model", $scope.model); var defaultConfig = { defaultIcon: "", size: "large" }; - var config = angular.extend({}, defaultConfig, $scope.model.config); + var config = angular.extend({}, defaultConfig, $scope.model.config); // TODO: Replace AngularJS dependency. [LK:2020-03-02] var vm = this; diff --git a/src/Umbraco.Community.Contentment/DataEditors/ItemPicker/item-picker.js b/src/Umbraco.Community.Contentment/DataEditors/ItemPicker/item-picker.js index c46265c5..eb87d76a 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/ItemPicker/item-picker.js +++ b/src/Umbraco.Community.Contentment/DataEditors/ItemPicker/item-picker.js @@ -26,7 +26,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. overlayOrderBy: "name", enableDevMode: 0, }; - var config = angular.extend({}, defaultConfig, $scope.model.config); + var config = angular.extend({}, defaultConfig, $scope.model.config); // TODO: Replace AngularJS dependency. [LK:2020-03-02] var vm = this; @@ -90,7 +90,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. submit: function (selectedItems) { _.each(selectedItems, function (x) { - vm.items.push(angular.copy(x)); + vm.items.push(angular.copy(x)); // TODO: Replace AngularJS dependency. [LK:2020-03-02] $scope.model.value.push(x.value); }); @@ -120,7 +120,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. _.each($scope.model.value, function (v) { var item = _.find(config.items, function (x) { return x.value === v }); if (item) { - vm.items.push(angular.copy(item)); + vm.items.push(angular.copy(item)); // TODO: Replace AngularJS dependency. [LK:2020-03-02] } else { orphaned.push(v); } diff --git a/src/Umbraco.Community.Contentment/DataEditors/ItemPicker/item-picker.overlay.js b/src/Umbraco.Community.Contentment/DataEditors/ItemPicker/item-picker.overlay.js index 188c7731..b4b279f9 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/ItemPicker/item-picker.overlay.js +++ b/src/Umbraco.Community.Contentment/DataEditors/ItemPicker/item-picker.overlay.js @@ -17,7 +17,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.Overlays.Ite listType: "grid", orderBy: "name", }; - var config = angular.extend({}, defaultConfig, $scope.model.config); + var config = angular.extend({}, defaultConfig, $scope.model.config); // TODO: Replace AngularJS dependency. [LK:2020-03-02] var vm = this; diff --git a/src/Umbraco.Community.Contentment/DataEditors/MacroPicker/macro-picker.js b/src/Umbraco.Community.Contentment/DataEditors/MacroPicker/macro-picker.js index 0b318004..af5c745d 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/MacroPicker/macro-picker.js +++ b/src/Umbraco.Community.Contentment/DataEditors/MacroPicker/macro-picker.js @@ -16,7 +16,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. maxItems: 0, disableSorting: 0 }; - var config = angular.extend({}, defaultConfig, $scope.model.config); + var config = angular.extend({}, defaultConfig, $scope.model.config); // TODO: Replace AngularJS dependency. [LK:2020-03-02] var vm = this; diff --git a/src/Umbraco.Community.Contentment/DataEditors/RadioButtonList/radio-button-list.js b/src/Umbraco.Community.Contentment/DataEditors/RadioButtonList/radio-button-list.js index 60194f8a..752abdfd 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/RadioButtonList/radio-button-list.js +++ b/src/Umbraco.Community.Contentment/DataEditors/RadioButtonList/radio-button-list.js @@ -15,7 +15,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. showIcons: 0, defaultValue: "" }; - var config = angular.extend({}, defaultConfig, $scope.model.config); + var config = angular.extend({}, defaultConfig, $scope.model.config); // TODO: Replace AngularJS dependency. [LK:2020-03-02] var vm = this; @@ -26,7 +26,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. $scope.model.value = _.first($scope.model.value); } - vm.items = angular.copy(config.items); + vm.items = angular.copy(config.items); // TODO: Replace AngularJS dependency. [LK:2020-03-02] vm.showDescriptions = Object.toBoolean(config.showDescriptions); vm.showIcons = Object.toBoolean(config.showIcons); diff --git a/src/Umbraco.Community.Contentment/DataEditors/RenderMacro/render-macro.js b/src/Umbraco.Community.Contentment/DataEditors/RenderMacro/render-macro.js index 3bb874b8..57ca285a 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/RenderMacro/render-macro.js +++ b/src/Umbraco.Community.Contentment/DataEditors/RenderMacro/render-macro.js @@ -21,7 +21,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. var macro = _.first($scope.model.config.macro); - angular.extend(macro.params, { + angular.extend(macro.params, { // TODO: Replace AngularJS dependency. [LK:2020-03-02] "__propertyAlias": $scope.model.alias, "__propertyLabel": $scope.model.label, "__propertyCulture": $scope.model.culture, diff --git a/src/Umbraco.Community.Contentment/DataEditors/TextInput/text-input.js b/src/Umbraco.Community.Contentment/DataEditors/TextInput/text-input.js index 1f24cb7a..d6125f5a 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/TextInput/text-input.js +++ b/src/Umbraco.Community.Contentment/DataEditors/TextInput/text-input.js @@ -18,7 +18,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. append: null, maxChars: 500 }; - var config = angular.extend({}, defaultConfig, $scope.model.config); + var config = angular.extend({}, defaultConfig, $scope.model.config); // TODO: Replace AngularJS dependency. [LK:2020-03-02] var vm = this; diff --git a/src/Umbraco.Community.Contentment/DataEditors/Toggles/toggles.js b/src/Umbraco.Community.Contentment/DataEditors/Toggles/toggles.js index d5098849..b25ddc78 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/Toggles/toggles.js +++ b/src/Umbraco.Community.Contentment/DataEditors/Toggles/toggles.js @@ -10,7 +10,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. // console.log("toggles.model", $scope.model); var defaultConfig = { items: [], showDescriptions: 1, defaultValue: [] }; - var config = angular.extend({}, defaultConfig, $scope.model.config); + var config = angular.extend({}, defaultConfig, $scope.model.config); // TODO: Replace AngularJS dependency. [LK:2020-03-02] var vm = this; @@ -21,7 +21,7 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. $scope.model.value = [$scope.model.value]; } - vm.items = angular.copy(config.items); + vm.items = angular.copy(config.items); // TODO: Replace AngularJS dependency. [LK:2020-03-02] var removeDescriptions = Object.toBoolean(config.showDescriptions) == false; diff --git a/src/Umbraco.Community.Contentment/DataEditors/_/_dev-mode.js b/src/Umbraco.Community.Contentment/DataEditors/_/_dev-mode.js index 79a56b05..1e92ce55 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/_/_dev-mode.js +++ b/src/Umbraco.Community.Contentment/DataEditors/_/_dev-mode.js @@ -10,7 +10,7 @@ angular.module("umbraco.services").factory("Umbraco.Community.Contentment.Servic editValue: function (model, callback) { editorService.open({ title: "Edit raw value", - value: angular.toJson(model.value, true), + value: angular.toJson(model.value, true), // TODO: Replace AngularJS dependency. [LK:2020-03-02] ace: { showGutter: true, useWrapMode: true, @@ -26,7 +26,7 @@ angular.module("umbraco.services").factory("Umbraco.Community.Contentment.Servic size: "small", submit: function (value) { - model.value = angular.fromJson(value); + model.value = angular.fromJson(value); // TODO: Replace AngularJS dependency. [LK:2020-03-02] if (callback) { callback();