Multinode treepicker now supports media,content,members + search
This commit is contained in:
@@ -5,7 +5,8 @@ angular.module("umbraco").controller("Umbraco.Dialogs.TreePickerController",
|
||||
$scope.dialogTreeEventHandler = $({});
|
||||
$scope.section = dialogOptions.section;
|
||||
$scope.treeAlias = dialogOptions.treeAlias;
|
||||
|
||||
$scope.multiPicker = dialogOptions.multiPicker;
|
||||
|
||||
//search defaults
|
||||
$scope.searcher = searchService.searchContent;
|
||||
$scope.entityType ="Document";
|
||||
@@ -21,7 +22,7 @@ angular.module("umbraco").controller("Umbraco.Dialogs.TreePickerController",
|
||||
|
||||
function select(id){
|
||||
entityResource.getById(id, $scope.entityType).then(function(ent){
|
||||
if(dialogOptions && dialogOptions.multiPicker){
|
||||
if($scope.multiPicker){
|
||||
|
||||
$scope.showSearch = false;
|
||||
$scope.results = [];
|
||||
@@ -64,7 +65,7 @@ angular.module("umbraco").controller("Umbraco.Dialogs.TreePickerController",
|
||||
|
||||
select(args.node.id);
|
||||
|
||||
if(dialogOptions && dialogOptions.multiPicker){
|
||||
if($scope.multiPicker){
|
||||
var c = $(args.event.target.parentElement);
|
||||
if(!args.node.selected){
|
||||
args.node.selected = true;
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
<div class="umb-panel-footer" ng-show="multiPicker">
|
||||
<div class="umb-el-wrap umb-panel-buttons">
|
||||
<div class="btn-toolbar umb-btn-toolbar pull-right">
|
||||
<input type="button" ng-click="submit(dialogData)" class="btn btn-primary" value="select" />
|
||||
<input type="button" ng-click="submit(dialogData)" class="btn btn-primary" value="select ({{dialogData.selection.length}})" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<div class="umb-pane">
|
||||
<h5>Your profile</h5>
|
||||
<p>
|
||||
<a href="#/framed/%252Fumbraco%252Fusers%252Fedituser.aspx%253Fid%253D{{user.id}}" class="btn btn-primary">Edit your profile</a>
|
||||
<a href="#/users/framed/%252Fumbraco%252Fusers%252Fedituser.aspx%253Fid%253D{{user.id}}" class="btn btn-primary">Edit your profile</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<select ng-model="model.value">
|
||||
<option value="content">Content</option>
|
||||
<option value="content">Media</option>
|
||||
<option value="media">Media</option>
|
||||
<option value="member">Members</option>
|
||||
</select>
|
||||
@@ -7,13 +7,19 @@ angular.module('umbraco')
|
||||
$scope.ids = $scope.model.value.split(',');
|
||||
|
||||
$scope.renderModel = [];
|
||||
$scope.cfg = {multipicker: false, type: "content", filter: ""};
|
||||
$scope.cfg = {multiPicker: false, entityType: "Document", type: "content", treeAlias: "content", filter: ""};
|
||||
|
||||
if($scope.model.config){
|
||||
$scope.cfg = $scope.model.config;
|
||||
$scope.cfg = angular.extend($scope.cfg, $scope.model.config);
|
||||
}
|
||||
|
||||
entityResource.getByIds($scope.ids, "Document").then(function(data){
|
||||
if($scope.cfg.type === "member"){
|
||||
$scope.cfg.entityType = "Member";
|
||||
}else if($scope.cfg.type === "media"){
|
||||
$scope.cfg.entityType = "Media";
|
||||
}
|
||||
|
||||
entityResource.getByIds($scope.ids, $scope.cfg.entityType).then(function(data){
|
||||
$(data).each(function(i, item){
|
||||
item.icon = iconHelper.convertFromLegacyIcon(item.icon);
|
||||
$scope.renderModel.push({name: item.name, id: item.id, icon: item.icon});
|
||||
|
||||
Reference in New Issue
Block a user