adding paste feature + cleaning css
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
.umb-itempicker .form-search {
|
||||
margin-top:10px;
|
||||
}
|
||||
.umb-card-grid {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
@@ -87,23 +87,11 @@
|
||||
|
||||
.umb-nested-content__icons {
|
||||
opacity: 0;
|
||||
transition: opacity .15s ease-in-out;
|
||||
transition: opacity 120ms ease-in-out;
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
top: 2px;
|
||||
background-color: @white;
|
||||
right: 8px;
|
||||
top: 4px;
|
||||
padding: 5px;
|
||||
|
||||
&:before {
|
||||
content: ' ';
|
||||
position: absolute;
|
||||
display: block;
|
||||
width: 30px;
|
||||
left: -30px;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
background: linear-gradient(90deg, rgba(255,255,255,0), white);
|
||||
}
|
||||
}
|
||||
|
||||
.umb-nested-content__item--active {
|
||||
@@ -130,41 +118,22 @@
|
||||
|
||||
|
||||
|
||||
.umb-nested-content__icon,
|
||||
.umb-nested-content__icon.umb-nested-content__icon--disabled:hover {
|
||||
.umb-nested-content__icon {
|
||||
display: inline-block;
|
||||
padding: 4px 6px;
|
||||
padding: 4px;
|
||||
margin: 2px;
|
||||
cursor: pointer;
|
||||
background: @white;
|
||||
border: 1px solid @gray-7;
|
||||
border-radius: 200px;
|
||||
text-decoration: none !important;
|
||||
color: @ui-option-type;
|
||||
}
|
||||
|
||||
.umb-nested-content__icon.umb-nested-content__icon--disabled:hover {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.umb-nested-content__icon:hover,
|
||||
.umb-nested-content__icon--active
|
||||
{
|
||||
color: @white;
|
||||
background: @blueMid;
|
||||
border-color: @blueMid;
|
||||
.umb-nested-content__icon:hover {
|
||||
color: @ui-option-type-hover;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.umb-nested-content__icon .icon,
|
||||
.umb-nested-content__icon.umb-nested-content__icon--disabled:hover .icon {
|
||||
.umb-nested-content__icon .icon {
|
||||
display: block;
|
||||
font-size: 16px !important;
|
||||
color: @gray-3;
|
||||
}
|
||||
|
||||
.umb-nested-content__icon:hover .icon,
|
||||
.umb-nested-content__icon--active .icon {
|
||||
color: @white;
|
||||
}
|
||||
|
||||
.umb-nested-content__icon--disabled {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
<ul class="umb-card-grid" ng-class="{'-three-in-row': model.availableItems.length < 7, '-four-in-row': model.availableItems.length >= 7}">
|
||||
<li ng-repeat="pasteItem in model.pasteItems | filter:searchTerm"
|
||||
ng-click="pasteItem(pasteItem)">
|
||||
ng-click="model.clickPasteItem(pasteItem)">
|
||||
<a class="umb-card-grid-item" href="" title="{{ pasteItem.name }}">
|
||||
<span>
|
||||
<i class="{{ pasteItem.icon }}"></i>
|
||||
|
||||
@@ -127,11 +127,16 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.NestedContent.Prop
|
||||
$scope.overlayMenu = {
|
||||
show: false,
|
||||
style: {},
|
||||
filter: $scope.scaffolds.length > 15 ? true : false,
|
||||
filter: $scope.scaffolds.length > 12 ? true : false,
|
||||
orderBy: "$index",
|
||||
view: "itempicker",
|
||||
event: $event,
|
||||
submit: function(model) {
|
||||
clickPasteItem: function(item) {
|
||||
$scope.pasteFromClipboard(item.data);
|
||||
$scope.overlayMenu.show = false;
|
||||
$scope.overlayMenu = null;
|
||||
},
|
||||
submit: function(model) {
|
||||
if(model && model.selectedItem) {
|
||||
$scope.addNode(model.selectedItem.alias);
|
||||
}
|
||||
@@ -166,6 +171,7 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.NestedContent.Prop
|
||||
$scope.overlayMenu.pasteItems.push({
|
||||
alias: node.contentTypeAlias,
|
||||
name: node.name, //contentTypeName
|
||||
data: node,
|
||||
icon: iconHelper.convertFromLegacyIcon(node.icon)
|
||||
});
|
||||
});
|
||||
@@ -310,13 +316,6 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.NestedContent.Prop
|
||||
$event.stopPropagation();
|
||||
}
|
||||
|
||||
$scope.clickPaste = function($event) {
|
||||
|
||||
var newNode = copyService.retriveDataOfType("elementType", contentTypeAliases).pop();
|
||||
$scope.pasteFromClipboard(newNode);
|
||||
|
||||
}
|
||||
|
||||
$scope.pasteFromClipboard = function(newNode) {
|
||||
|
||||
if (newNode === undefined) {
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
<div class="umb-nested-content__heading"><i ng-if="showIcons" class="icon" ng-class="$parent.getIcon($index)"></i><span class="umb-nested-content__item-name" ng-bind="$parent.getName($index)"></span></div>
|
||||
|
||||
<div class="umb-nested-content__icons">
|
||||
<a class="umb-nested-content__icon umb-nested-content__icon--delete" localize="title" title="general_delete" ng-class="{ 'umb-nested-content__icon--disabled': $parent.nodes.length <= $parent.minItems }" ng-click="$parent.deleteNode($index); $event.stopPropagation();" prevent-default>
|
||||
<i class="icon icon-trash"></i>
|
||||
</a>
|
||||
<a class="umb-nested-content__icon umb-nested-content__icon--copy" title="{{copyIconTitle}}" ng-click="clickCopy($event, node);" ng-if="showCopy" prevent-default>
|
||||
<i class="icon icon-documents"></i>
|
||||
</a>
|
||||
<a class="umb-nested-content__icon umb-nested-content__icon--delete" localize="title" title="general_delete" ng-class="{ 'umb-nested-content__icon--disabled': $parent.nodes.length <= $parent.minItems }" ng-click="$parent.deleteNode($index); $event.stopPropagation();" prevent-default>
|
||||
<i class="icon icon-trash"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user