[About] Refactor overlay templates

Refactor overlay templates to separate out the overlay
container from the inner dialog containing the form;
this permits the easy reuse of that overlay container
to supply a non-form-like About dialog, WTD-667.
This commit is contained in:
Victor Woeltjen 2015-01-14 11:49:35 -08:00
parent b5ebe5b27f
commit 97d4f34ae2
4 changed files with 45 additions and 26 deletions

View File

@ -15,6 +15,16 @@
"templates": [
{
"key": "overlay-dialog",
"templateUrl": "templates/overlay-dialog.html"
},
{
"key": "form-dialog",
"templateUrl": "templates/dialog.html"
}
],
"containers": [
{
"key": "overlay",
"templateUrl": "templates/overlay.html"
}
]

View File

@ -0,0 +1,25 @@
<div class="abs top-bar">
<div class="title">{{ngModel.title}}</div>
<div class="hint">
All fields marked <span class="ui-symbol req">*</span> are required.
</div>
</div>
<div class="abs form outline editor">
<div class='abs contents'>
<mct-form ng-model="ngModel.value"
structure="ngModel.structure"
name="createForm">
</mct-form>
</div>
</div>
<div class="abs bottom-bar">
<a class='btn lg major'
href=''
ng-class="{ disabled: !createForm.$valid }"
ng-click="ngModel.confirm()">
OK
</a>
<a class='btn lg subtle' href='' ng-click="ngModel.cancel()">
Cancel
</a>
</div>

View File

@ -0,0 +1,4 @@
<mct-container key="overlay">
<mct-include key="'form-dialog'" ng-model="ngModel">
</mct-include>
</mct-container>

View File

@ -3,32 +3,12 @@
<div class="abs holder">
<a href=""
ng-click="ngModel.cancel()"
class="btn normal outline ui-symbol close">x</a>
<div class="abs contents">
<div class="abs top-bar">
<div class="title">{{ngModel.title}}</div>
<div class="hint">All fields marked <span class="ui-symbol req">*</span> are required.</div>
</div>
<div class="abs form outline editor">
<div class='abs contents'>
<!-- mct-include key="'form'" ng-model="" -->
<mct-form ng-model="ngModel.value"
structure="ngModel.structure"
name="createForm">
</mct-form>
</div>
</div>
<div class="abs bottom-bar">
<a class='btn lg major'
href=''
ng-class="{ disabled: !createForm.$valid }"
ng-click="ngModel.confirm()">
OK
</a>
<a class='btn lg subtle' href='' ng-click="ngModel.cancel()">
Cancel
</a>
</div>
ng-if="ngModel.cancel"
class="btn normal outline ui-symbol close">
x
</a>
<div class="abs contents" ng-transclude>
</div>
</div>
</div>