add UI to remove master template

This commit is contained in:
Mads Rasmussen
2016-12-29 13:50:57 +01:00
parent 61f25edafc
commit 82efa14b7a
2 changed files with 27 additions and 4 deletions

View File

@@ -143,6 +143,7 @@
vm.openMasterTemplateOverlay = openMasterTemplateOverlay;
vm.selectMasterTemplate = selectMasterTemplate;
vm.getMasterTemplateName = getMasterTemplateName;
vm.removeMasterTemplate = removeMasterTemplate;
function openInsertOverlay() {
@@ -403,6 +404,15 @@
}
function removeMasterTemplate() {
vm.template.masterTemplateAlias = null;
// call set layout with no paramters to set layout to null
setLayout();
}
function setLayout(templatePath){
var templateCode = vm.editor.getValue();

View File

@@ -25,10 +25,23 @@
<div class="flex" style="margin-bottom: 30px;">
<div class="flex">
<a class="btn btn-link" ng-click="vm.openMasterTemplateOverlay()">
<i class="icon icon-layout" style="margin-right:5px;"></i>
<span class="bold">Master template:</span> {{ vm.getMasterTemplateName(vm.template.masterTemplateAlias, vm.templates) }}
</a>
<div ng-class="{'btn-group umb-era-button-group': vm.template.masterTemplateAlias}" style="margin-right: 10px;">
<button
type="button"
class="umb-era-button umb-button--s"
ng-click="vm.openMasterTemplateOverlay()">
<i class="icon icon-layout"></i>
<span class="bold">Master template:</span> <span style="margin-left: 5px;">{{ vm.getMasterTemplateName(vm.template.masterTemplateAlias, vm.templates) }}</span>
</button>
<a ng-if="vm.template.masterTemplateAlias" ng-click="vm.removeMasterTemplate()" class="umb-era-button umb-button--s dropdown-toggle umb-button-group__toggle">
<span class="icon icon-wrong"></span>
</a>
</div>
</div>
<div class="flex" style="margin-left: auto;">