Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Umbraco.Web.UI.Client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Umbraco.Web.UI.Client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"ng-file-upload": "12.2.13",
"nouislider": "15.7.1",
"spectrum-colorpicker2": "2.0.10",
"tinymce": "6.7.0",
"tinymce": "6.7.1",
"typeahead.js": "0.11.1",
"underscore": "1.13.6",
"wicg-inert": "3.1.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,18 @@
$scope.activeApp = null;

//initializes any watches
var watchers = [];

function startWatches(content) {
clearWatchers();

$scope.$watchGroup(['culture', 'segment'],
watchers.push($scope.$watchGroup(['culture', 'segment'],
function (value, oldValue) {
createPreviewButton($scope.content, value[0], value[1]);
});
}));

//watch for changes to isNew, set the page.isNew accordingly and load the breadcrumb if we can
$scope.$watch('isNew', function (newVal, oldVal) {
watchers.push($scope.$watch('isNew', function (newVal, oldVal) {

$scope.page.isNew = Object.toBoolean(newVal);

Expand All @@ -59,8 +62,12 @@
});
}
}
});
}));
}

function clearWatchers () {
watchers.forEach(w => w());
watchers = [];
}

//this initializes the editor with the data which will be called more than once if the data is re-loaded
Expand Down Expand Up @@ -109,6 +116,7 @@
bindEvents();

resetVariantFlags();
startWatches($scope.content);
}

function loadBreadcrumb() {
Expand Down Expand Up @@ -241,7 +249,6 @@

appendRuntimeData();
init();
startWatches($scope.content);

syncTreeNode($scope.content, $scope.content.path, true);

Expand All @@ -265,7 +272,6 @@

appendRuntimeData();
init();
startWatches($scope.content);

resetLastListPageNumber($scope.content);

Expand Down Expand Up @@ -346,7 +352,10 @@
labelKey: "buttons_saveAndPreview"
};

const activeVariant = content.variants?.find((variant) => content.documentType?.variations === "Nothing" || variant.compositeId === compositeId);
let activeVariant = content.variants?.find((variant) => content.documentType?.variations === "Nothing" || variant.compositeId === compositeId);
/* if we can't find the active variant and there is only one variant available, we will use that.
this happens if we have a node that can vary by culture but there is only one language available. */
activeVariant = !activeVariant && content.variants.length === 1 ? content.variants[0] : activeVariant;

$scope.previewSubButtons = activeVariant?.additionalPreviewUrls?.map((additionalPreviewUrl) => {
return {
Expand Down
2 changes: 1 addition & 1 deletion templates/Umbraco.Templates.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<ItemGroup>
<Content Update="**\.template.config\template.json" Pack="false" />
</ItemGroup>
<Target Name="GetUpdatedTemplateJsonPackageFiles" BeforeTargets="GenerateNuspec" AfterTargets="GetBuildVersion;GetUmbracoBuildVersion">
<Target Name="GetUpdatedTemplateJsonPackageFiles" BeforeTargets="GenerateNuspec" AfterTargets="GetUmbracoBuildVersion">
<ItemGroup>
<_TemplateJsonFiles Include="**\.template.config\template.json" Exclude="bin\**;obj\**" />
<_TemplateJsonFiles>
Expand Down