Member: change button to umb-button

This commit is contained in:
Mads Rasmussen
2015-09-09 10:07:39 +02:00
parent 4ee97edf27
commit 255cbdbef2
2 changed files with 24 additions and 13 deletions

View File

@@ -37,19 +37,24 @@
</umb-editor-footer-content-left>
<umb-editor-footer-content-right ng-class="{'umb-dimmed': busy}">
<umb-editor-footer-content-right>
<div class="btn-group" ng-if="listViewPath">
<a class="btn" href="#{{listViewPath}}">
<localize key="buttons_returnToList">Return to list</localize>
</a>
</div>
<umb-button
ng-if="page.listViewPath"
type="link"
href="#{{page.listViewPath}}"
label="Return to list"
label-key="buttons_returnToList">
</umb-button>
<div class="btn-group">
<button type="submit" data-hotkey="ctrl+s" class="btn btn-success">
<localize key="buttons_save">Save</localize>
</button>
</div>
<umb-button
type="submit"
label="Save"
label-key="buttons_save"
button-style="success"
shortcut="ctrl+s"
state="page.saveButtonState">
</umb-button>
</umb-editor-footer-content-right>

View File

@@ -15,8 +15,10 @@ function MemberEditController($scope, $routeParams, $location, $q, $window, appS
$scope.page.menu.currentSection = appState.getSectionState("currentSection");
$scope.page.menu.currentNode = null; //the editors affiliated node
$scope.page.nameLocked = false;
$scope.page.listViewPath = null;
$scope.page.saveButtonState = "init";
$scope.listViewPath = ($routeParams.page && $routeParams.listName)
$scope.page.listViewPath = ($routeParams.page && $routeParams.listName)
? "/member/member/list/" + $routeParams.listName + "?page=" + $routeParams.page
: null;
@@ -130,6 +132,7 @@ function MemberEditController($scope, $routeParams, $location, $q, $window, appS
if (!$scope.busy && formHelper.submitForm({ scope: $scope, statusMessage: "Saving..." })) {
$scope.busy = true;
$scope.page.saveButtonState = "busy";
memberResource.save($scope.content, $routeParams.create, fileManager.getFiles())
.then(function(data) {
@@ -146,7 +149,8 @@ function MemberEditController($scope, $routeParams, $location, $q, $window, appS
editorState.set($scope.content);
$scope.busy = false;
$scope.page.saveButtonState = "success";
var path = buildTreePath(data);
//sync the tree (only for ui purposes)
@@ -162,6 +166,8 @@ function MemberEditController($scope, $routeParams, $location, $q, $window, appS
editorState.set($scope.content);
$scope.busy = false;
$scope.page.saveButtonState = "error";
});
}else{
$scope.busy = false;