save sort order
This commit is contained in:
@@ -21,27 +21,25 @@
|
||||
vm.save = save;
|
||||
|
||||
function onInit() {
|
||||
|
||||
vm.loading = true;
|
||||
|
||||
contentResource.getChildren(parentId)
|
||||
.then(function(data){
|
||||
vm.children = data.items;
|
||||
vm.loading = false;
|
||||
console.log(vm.children);
|
||||
});
|
||||
}
|
||||
|
||||
function save() {
|
||||
|
||||
console.log(vm.nodes);
|
||||
vm.saveButtonState = "busy";
|
||||
|
||||
var args = {
|
||||
parentId: parentId,
|
||||
sortedIds: _.map(vm.children, function(child){ return child.id; })
|
||||
};
|
||||
|
||||
// fake loading
|
||||
$timeout(function () {
|
||||
contentResource.sort(args).then(function(){
|
||||
vm.saveButtonState = "success";
|
||||
}, 1000);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function fixSortableHelper(e, ui) {
|
||||
|
||||
@@ -36,10 +36,12 @@
|
||||
</div>
|
||||
|
||||
<div class="umb-dialog-footer btn-toolbar umb-btn-toolbar">
|
||||
<a class="btn btn-link" ng-click="nav.hideDialog()">
|
||||
<localize key="general_cancel">Cancel</localize>
|
||||
</a>
|
||||
|
||||
<umb-button
|
||||
type="button"
|
||||
button-style="link"
|
||||
action="nav.hideDialog()"
|
||||
label-key="general_cancel">
|
||||
</umb-button>
|
||||
<umb-button
|
||||
type="button"
|
||||
action="vm.save()"
|
||||
@@ -47,7 +49,6 @@
|
||||
button-style="success"
|
||||
label-key="buttons_save">
|
||||
</umb-button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user