Skip to content

Commit

Permalink
make it work on 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanwoulfe committed Dec 12, 2019
1 parent f07d93b commit d89ebdb
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 50 deletions.
10 changes: 5 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# version format
version: 2.0.2.{build}
version: 2.1.0.{build}

image: Visual Studio 2017

Expand All @@ -11,7 +11,7 @@ cache:
install:
- set PATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe;C:\Ruby22\bin;%PATH%
- cmd: npm install -g gulp-cli
- cmd: set UMBRACO_PACKAGE_MIN_VERSION=8.1.0
- cmd: set UMBRACO_PACKAGE_MIN_VERSION=8.4.0
- cmd: cd BuildPackage
- cmd: Build.bat

Expand Down Expand Up @@ -39,9 +39,9 @@ deploy:
appveyor_repo_tag: true

- provider: GitHub
tag: v2.0.2
release: Release 2.0.2
description: "v8 bugfixes"
tag: v2.1.0
release: Release 2.1.0
description: "8.4 bugfixes"
force_update: true
auth_token:
secure: Otbl8p8qCwciDqJgSWCyN0Arfs5XS1CwiHcK+r0F6uz9Rxt4gzBFvlc3cjPV3NxR
Expand Down
18 changes: 18 additions & 0 deletions src/NestingContently/backoffice/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
(() => {

angular.module('nc.components', []);

angular.module('nc', [
'nc.components'
]);

angular.module('umbraco').requires.push('nc');

for (let q of angular.module('umbraco')._invokeQueue) {
if (q[2][0] === 'nestedContentPropertyEditor') {
const pattern = /<div class="umb-nested-content__icons">/gmi;
q[2][1].template = q[2][1].template.replace(pattern, '$&<nc-toggle node="node" index="$index" model="$parent.$parent.model"></nc-toggle>');
}
}

})();
13 changes: 6 additions & 7 deletions src/NestingContently/backoffice/button.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
function controller($element, $scope, locale) {

let prop = {};
let labels = {};
let labels = {};
let disabled = false;

locale.localizeMany(['actions_enable','actions_disable']).then(data => {
labels.enable = data[0];
labels.disable = data[1];
});

const disabledClass = 'umb-nested-content__item--disabled';
const itemClass = '.umb-nested-content__item';
const editorName = 'NestingContently';
Expand All @@ -26,15 +26,14 @@

prop.value = disabled ? 1 : 0;

this.parent.model.value[this.index].disabled = disabled;
this.parent.$parent.$parent.model.value[this.index].disabled = disabled;
this.model.value[this.index].disabled = disabled;

setTitle();
setClass('toggle');
}

this.$onInit = () => {
if (this.node) {
if (this.node) {
const props = this.node.variants[0].tabs[0]
.properties.filter(p => p.editor === editorName);

Expand Down Expand Up @@ -67,13 +66,13 @@
bindings: {
node: '<',
index: '<',
parent: '<'
model: '<'
},
controller: controller,
template: template
};

controller.$inject = ['$element', '$scope', 'localizationService'];

angular.module('umbraco.directives').component('ncToggle', component);
angular.module('nc.components').component('ncToggle', component);
})();
3 changes: 1 addition & 2 deletions src/NestingContently/backoffice/editor.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@
}

angular.module('umbraco').controller('nestingContentlyController', ['$element', nestingContently]);
})();

})();
4 changes: 1 addition & 3 deletions src/NestingContently/backoffice/editor.html
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
<div ng-controller="nestingContentlyController as vm">
{{ model.value }}
</div>
<div ng-controller="nestingContentlyController as vm"></div>
32 changes: 0 additions & 32 deletions src/NestingContently/backoffice/interceptor.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/NestingContently/package.dev.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
'~/app_plugins/nestingcontently/backoffice/styles.css'
],
javascript: [
'~/app_plugins/nestingcontently/backoffice/app.js',
'~/app_plugins/nestingcontently/backoffice/editor.controller.js',
'~/app_plugins/nestingcontently/backoffice/interceptor.js',
'~/app_plugins/nestingcontently/backoffice/button.component.js'

]
Expand Down

0 comments on commit d89ebdb

Please sign in to comment.