Clean-up with Mads
This commit is contained in:
@@ -9,6 +9,10 @@ function mediaPickerController($scope, dialogService, entityResource, $log, icon
|
||||
|
||||
$scope.renderModel = [];
|
||||
|
||||
$scope.allowRemove = true;
|
||||
$scope.allowEdit = true;
|
||||
$scope.sortable = false;
|
||||
|
||||
var dialogOptions = {
|
||||
multiPicker: false,
|
||||
entityType: "Media",
|
||||
@@ -90,13 +94,16 @@ function mediaPickerController($scope, dialogService, entityResource, $log, icon
|
||||
if (modelIds.length > 0) {
|
||||
entityResource.getByIds(modelIds, dialogOptions.entityType).then(function (data) {
|
||||
_.each(data, function (item, i) {
|
||||
item.icon = iconHelper.convertFromLegacyIcon(item.icon);
|
||||
$scope.renderModel.push({ name: item.name, id: item.id, path: item.path, icon: item.icon, udi: item.udi });
|
||||
|
||||
entityResource.getUrl(item.id, "Media").then(function(data){
|
||||
item.path = data;
|
||||
item.icon = iconHelper.convertFromLegacyIcon(item.icon);
|
||||
$scope.renderModel.push({ name: item.name, id: item.id, path: item.path, icon: item.icon, udi: item.udi });
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
angular.module('umbraco').controller("Umbraco.PrevalueEditors.MediaPickerController",mediaPickerController);
|
||||
@@ -1,18 +1,16 @@
|
||||
<div ng-controller="Umbraco.PrevalueEditors.MediaPickerController" class="umb-editor umb-contentpicker">
|
||||
|
||||
<div ui-sortable="sortableOptions" ng-model="renderModel">
|
||||
<div ng-model="renderModel">
|
||||
<umb-node-preview
|
||||
ng-repeat="node in renderModel"
|
||||
icon="node.icon"
|
||||
name="node.name"
|
||||
published="node.published"
|
||||
description="node.path"
|
||||
sortable="!sortableOptions.disabled"
|
||||
allow-remove="remove"
|
||||
allow-open="model.config.showOpenButton && allowOpenButton && !dialogEditor"
|
||||
allow-edit=""
|
||||
sortable="sortable"
|
||||
allow-remove="allowRemove"
|
||||
allow-edit="allowEdit"
|
||||
on-remove="remove($index)"
|
||||
on-open="openMiniEditor(node)"
|
||||
on-edit="openContentPicker()">
|
||||
</umb-node-preview>
|
||||
</div>
|
||||
|
||||
@@ -7,6 +7,9 @@ angular.module('umbraco')
|
||||
$scope.renderModel = [];
|
||||
$scope.ids = [];
|
||||
|
||||
$scope.allowRemove = true;
|
||||
$scope.allowEdit = true;
|
||||
$scope.sortable = false;
|
||||
|
||||
var config = {
|
||||
multiPicker: false,
|
||||
@@ -25,8 +28,11 @@ angular.module('umbraco')
|
||||
$scope.ids = $scope.model.value.split(',');
|
||||
entityResource.getByIds($scope.ids, config.entityType).then(function (data) {
|
||||
_.each(data, function (item, i) {
|
||||
item.icon = iconHelper.convertFromLegacyIcon(item.icon);
|
||||
$scope.renderModel.push({ name: item.name, id: item.id, icon: item.icon, udi: item.udi });
|
||||
entityResource.getUrl(item.id, "Document").then(function(data){
|
||||
item.path = data;
|
||||
item.icon = iconHelper.convertFromLegacyIcon(item.icon);
|
||||
$scope.renderModel.push({name: item.name, path: item.path, id: item.id, icon: item.icon, udi: item.udi});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -45,11 +51,6 @@ angular.module('umbraco')
|
||||
populate(model.selection[0]);
|
||||
}
|
||||
|
||||
console.log(model);
|
||||
/* entityResource.getUrl(updatedNode.id, entityType).then(function(data){
|
||||
node.url = data;
|
||||
}); */
|
||||
|
||||
$scope.treePickerOverlay.show = false;
|
||||
$scope.treePickerOverlay = null;
|
||||
};
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
<div ng-controller="Umbraco.PrevalueEditors.TreePickerController" class="umb-editor umb-contentpicker">
|
||||
|
||||
<div ui-sortable="sortableOptions" ng-model="renderModel">
|
||||
<div ng-model="renderModel">
|
||||
<umb-node-preview
|
||||
ng-repeat="node in renderModel"
|
||||
icon="node.icon"
|
||||
name="node.name"
|
||||
published="node.published"
|
||||
description="node.path"
|
||||
sortable="!sortableOptions.disabled"
|
||||
allow-remove="remove"
|
||||
allow-open="model.config.showOpenButton && allowOpenButton && !dialogEditor"
|
||||
allow-edit=""
|
||||
sortable="sortable"
|
||||
allow-remove="allowRemove"
|
||||
allow-edit="allowEdit"
|
||||
on-remove="remove($index)"
|
||||
on-open="openMiniEditor(node)"
|
||||
on-edit="openContentPicker()">
|
||||
</umb-node-preview>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user