Add cloned content when sorting

This commit is contained in:
Rune Strand
2015-11-18 12:13:51 +01:00
parent 6fa94b4f5d
commit eff0ef027a
2 changed files with 22 additions and 26 deletions

View File

@@ -13,11 +13,9 @@
.umb-grid .ui-sortable-helper {
position:absolute !important;
// border: dashed 1px #000 !important;
background-color: @blue;
opacity: 0.4;
height: auto !important;
width: 150px !important;
height: 50px !important;
width: 50px !important;
overflow: hidden;
padding: 5px;
border-radius:2px;
@@ -26,15 +24,15 @@
box-shadow: 3px 3px 12px 0px rgba(50, 50, 50, 0.45);
}
// .umb-grid .ui-sortable-helper:after {
// line-height: 15px;
// font-size: 25px;
// content: "\e14e";
// color: #ffffff;
// }
.umb-grid .ui-sortable-helper:after {
line-height: 50px;
font-size: 25px;
content: "\e14e";
color: #ffffff;
}
.umb-grid .ui-sortable-helper *{
// display: none;
display: none;
border: none !important;
background: none !important;
color: #ffffff !important;
@@ -51,7 +49,6 @@
.umb-grid .ui-sortable-placeholder{
position: absolute;
width: 100%;
color: @gray;
background-color:@blue;
height: 2px;
margin-bottom: 20px;
@@ -75,15 +72,6 @@
right: -5px;
content: "\e0d7";
}
// .umb-grid .ui-sortable-placeholder:hover{
// border-color: @gray;
// }
//
// .umb-grid .ui-sortable-placeholder:before{
// content: "\e1bd";
// }
// utils
// -------------------------

View File

@@ -22,18 +22,19 @@ angular.module("umbraco")
cursor: "move",
placeholder: "ui-sortable-placeholder",
handle: ".cell-tools-move",
helper: "clone",
forcePlaceholderSize: true,
tolerance: "pointer",
zIndex: 999999999999999999,
scrollSensitivity: 100,
cursorAt: {
top: 45,
left: 90
},
// cursorAt: {
// top: 45,
// left: 90
// },
sort: function (event, ui) {
/* prevent vertical scroll out of the screen */
var max = $(".usky-grid").width() - 150;
var max = $(".umb-grid").width() - 150;
if (parseInt(ui.helper.css("left")) > max) {
ui.helper.css({ "left": max + "px" });
}
@@ -43,6 +44,10 @@ angular.module("umbraco")
},
start: function (e, ui) {
ui.item.context.style.opacity = "0.5";
ui.item.context.style.display = "block";
draggedRteSettings = {};
ui.item.find(".mceNoEditor").each(function () {
// remove all RTEs in the dragged row and save their settings
@@ -53,6 +58,9 @@ angular.module("umbraco")
},
stop: function (e, ui) {
ui.item.context.style.opacity = "1";
// reset all RTEs affected by the dragging
ui.item.parents(".usky-column").find(".mceNoEditor").each(function () {
var id = $(this).attr("id");