Working move dialog, needs feedback and validation

This commit is contained in:
perploug
2013-10-01 16:14:54 +02:00
parent 1ec74a5ae8
commit 2e8a8e3623
3 changed files with 20 additions and 10 deletions

View File

@@ -268,14 +268,14 @@ angular.module('umbraco.services')
* template is located in views/common/dialogs/user.html
*/
showUserDialog: function () {
userDialog = dialogService.open(
service.userDialog = dialogService.open(
{
template: "views/common/dialogs/user.html",
modalClass: "umb-modal-left",
show: true
});
return userDialog;
return service.userDialog;
},
/**
@@ -288,9 +288,9 @@ angular.module('umbraco.services')
* template is located in views/common/dialogs/user.html
*/
hideUserDialog: function () {
if(userDialog){
userDialog.close();
userDialog = undefined;
if(service.userDialog){
service.userDialog.close();
service.userDialog = undefined;
}
},
@@ -374,6 +374,8 @@ angular.module('umbraco.services')
{
container: $("#dialog div.umb-modalcolumn-body"),
scope: scope,
currentNode: args.node,
currentAction: args.action,
inline: true,
show: true,
iframe: iframe,
@@ -383,7 +385,6 @@ angular.module('umbraco.services')
//save the currently assigned dialog so it can be removed before a new one is created
this.ui.currentDialog = dialog;
return dialog;
},

View File

@@ -1,17 +1,23 @@
//used for the media picker dialog
angular.module("umbraco").controller("Umbraco.Editors.Content.MoveController",
function ($scope, eventsService, $log) {
function ($scope, eventsService, contentResource, $log) {
var dialogOptions = $scope.$parent.dialogOptions;
$scope.dialogTreeEventHandler = $({});
$scope.section = dialogOptions.section;
var node = dialogOptions.currentNode;
$scope.dialogTreeEventHandler.bind("treeNodeSelect", function(ev, args){
args.event.preventDefault();
args.event.stopPropagation();
eventsService.publish("Umbraco.Content.MoveController.Select", args).then(function(args){
contentResource.move({parentId: args.node.id, id:node.id})
.then(function(){
alert("moved");
},function(err){
alert(err);
});
});
});

View File

@@ -1,5 +1,8 @@
<div class="umb-dialog-body" ng-controller="Umbraco.Editors.Content.MoveController">
<div class="umb-pane">
<p>Choose where to move {{currentNode.name}} to in the tree struture below</p>
<umb-tree
section="content"
cachekey="movepickerDialog"