Updates member group picker dialog

This commit is contained in:
Tim Geyssens
2013-10-30 13:47:54 +01:00
parent 21f0e60061
commit 69e445239a

View File

@@ -8,6 +8,7 @@ angular.module("umbraco").controller("Umbraco.Dialogs.MemberGroupPickerControlle
/** Method used for selecting a node */
function select(text, id, entity) {
$scope.showSearch = false;
$scope.results = [];
$scope.term = "";
@@ -17,27 +18,12 @@ angular.module("umbraco").controller("Umbraco.Dialogs.MemberGroupPickerControlle
$scope.select(id);
}
else {
//if an entity has been passed in, use it
if (entity) {
$scope.submit(entity);
}
else {
//otherwise we have to get it from the server
entityResource.getById(id, "Member").then(function (ent) {
$scope.submit(ent);
});
}
$scope.submit(id);
}
}
/** method to select a search result */
$scope.selectResult = function(result) {
//since result = an entity, we'll pass it in so we don't have to go back to the server
select(result.name, result.id, result);
};
$scope.dialogTreeEventHandler.bind("treeNodeSelect", function(ev, args) {
args.event.preventDefault();
args.event.stopPropagation();