From dece68022136e64c64b32bda0f4b0124271dfa05 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Fri, 30 Dec 2016 11:36:20 +0100 Subject: [PATCH] =?UTF-8?q?Fixes:=20U4-9328=20UI:=20It=20shouldn=E2=80=99t?= =?UTF-8?q?=20be=20possible=20to=20select=20the=20current=20template=20or?= =?UTF-8?q?=20the=20selected=20master=20template=20in=20the=20master=20tem?= =?UTF-8?q?plate=20picker.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/templates/edit.controller.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js index a029b0ed12..327da032b8 100644 --- a/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js @@ -332,10 +332,20 @@ function openMasterTemplateOverlay() { + // make collection of available master templates + var availableMasterTemplates = []; + + // filter out the current template and the selected master template + angular.forEach(vm.templates, function(template){ + if(template.alias !== vm.template.alias && template.alias !== vm.template.masterTemplateAlias) { + availableMasterTemplates.push(template); + } + }); + vm.masterTemplateOverlay = { view: "itempicker", title: "Choose master template", - availableItems: vm.templates, + availableItems: availableMasterTemplates, show: true, submit: function(model) {