Media: change button to umb-button
This commit is contained in:
@@ -36,19 +36,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-show="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>
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@ function mediaEditController($scope, $routeParams, appState, mediaResource, enti
|
||||
$scope.page.menu = {};
|
||||
$scope.page.menu.currentSection = appState.getSectionState("currentSection");
|
||||
$scope.page.menu.currentNode = null; //the editors affiliated node
|
||||
$scope.page.listViewPath = null;
|
||||
$scope.page.saveButtonState = "init";
|
||||
|
||||
/** Syncs the content item to it's tree node - this occurs on first load and after saving */
|
||||
function syncTreeNode(content, path, initialLoad) {
|
||||
@@ -65,7 +67,7 @@ function mediaEditController($scope, $routeParams, appState, mediaResource, enti
|
||||
$scope.content = data;
|
||||
|
||||
if (data.isChildOfListView && data.trashed === false) {
|
||||
$scope.listViewPath = ($routeParams.page)
|
||||
$scope.page.listViewPath = ($routeParams.page)
|
||||
? "/media/media/edit/" + data.parentId + "?page=" + $routeParams.page
|
||||
: "/media/media/edit/" + data.parentId;
|
||||
}
|
||||
@@ -98,6 +100,7 @@ function mediaEditController($scope, $routeParams, appState, mediaResource, enti
|
||||
if (!$scope.busy && formHelper.submitForm({ scope: $scope, statusMessage: "Saving..." })) {
|
||||
|
||||
$scope.busy = true;
|
||||
$scope.page.saveButtonState = "busy";
|
||||
|
||||
mediaResource.save($scope.content, $routeParams.create, fileManager.getFiles())
|
||||
.then(function(data) {
|
||||
@@ -115,6 +118,8 @@ function mediaEditController($scope, $routeParams, appState, mediaResource, enti
|
||||
|
||||
syncTreeNode($scope.content, data.path);
|
||||
|
||||
$scope.page.saveButtonState = "success";
|
||||
|
||||
}, function(err) {
|
||||
|
||||
contentEditingHelper.handleSaveError({
|
||||
@@ -125,6 +130,8 @@ function mediaEditController($scope, $routeParams, appState, mediaResource, enti
|
||||
|
||||
editorState.set($scope.content);
|
||||
$scope.busy = false;
|
||||
$scope.page.saveButtonState = "error";
|
||||
|
||||
});
|
||||
}else{
|
||||
$scope.busy = false;
|
||||
|
||||
Reference in New Issue
Block a user