Working move dialog, needs feedback and validation
This commit is contained in:
@@ -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;
|
||||
},
|
||||
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user