1
0
Fork 0

Fixed drag and drop

master
Matthieu Lalonde 12 years ago
parent 39bc55c93f
commit 47e8765709

@ -459,18 +459,18 @@ div#screen canvas#processcanvas {
} }
@-webkit-keyframes pulse { @-webkit-keyframes pulse {
0% {opacity: 0;color: #000;} 0% {opacity: 1;color: #fff;}
25% {opacity: 0.25;} 25% {opacity: 0.75;}
50% {opacity: 0.50;} 50% {opacity: 0.50;}
75% {opacity: 0.75;} 75% {opacity: 0.25;}
100% {opacity: 1;color: #fff;} 100% {opacity: 0;color: #999;}
} }
.droppable { .droppable {
-webkit-animation: pulse 1s infinite alternate; /*-webkit-animation: pulse 1s infinite alternate;
-moz-animation: pulse 1s infinite alternate; -moz-animation: pulse 1s infinite alternate;
opacity: 0; opacity: 0;
color: #FFF; color: #FFF;*/
background-color: #4966B1;/* Old browsers */ background-color: #4966B1;/* Old browsers */
background: -moz-linear-gradient(top, #6086e5 0%, #6086e5 39%, #4966b1 100%); /* FF3.6+ */ background: -moz-linear-gradient(top, #6086e5 0%, #6086e5 39%, #4966b1 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6086e5), color-stop(39%,#6086e5), color-stop(100%,#4966b1)); /* Chrome,Safari4+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6086e5), color-stop(39%,#6086e5), color-stop(100%,#4966b1)); /* Chrome,Safari4+ */
@ -499,4 +499,24 @@ div#screen canvas#processcanvas {
-webkit-animation: none; -webkit-animation: none;
-moz-animation: none; -moz-animation: none;
opacity: 1; opacity: 1;
}
div.drag-table-item table tr.selected td {
padding-left: 5px;
padding-right: 5px;
}
.droppable-hover {
-webkit-animation: pulse 1s infinite alternate;
-moz-animation: pulse 1s infinite alternate;
opacity: 0;
color: #FFF;
background-color: #4966B1;/* Old browsers */
background: -moz-linear-gradient(top, #6086e5 0%, #6086e5 39%, #4966b1 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6086e5), color-stop(39%,#6086e5), color-stop(100%,#4966b1)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #6086e5 0%,#6086e5 39%,#4966b1 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #6086e5 0%,#6086e5 39%,#4966b1 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #6086e5 0%,#6086e5 39%,#4966b1 100%); /* IE10+ */
background: linear-gradient(to bottom, #6086e5 0%,#6086e5 39%,#4966b1 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6086e5', endColorstr='#4966b1',GradientType=0 ); /* IE6-9 */
} }

@ -359,10 +359,13 @@ console.log(parentWidth, that.$el.innerWidth(), parentHeight, that.$el, parentEl
, fnCreatedRow: function(nRow, aData, iDataIndex) { , fnCreatedRow: function(nRow, aData, iDataIndex) {
if (that.options.type !== "playlist") { if (that.options.type !== "playlist") {
$(nRow).draggable({ $(nRow).draggable({
scope: "list-item" scope: "list-item"
, cursor: "move" , stack: "droppable"
, revert: "invalid" , cursor: "copy"
, containment: "window" , revert: "invalid"
, containment: "window"
, revertDuration: 200
, scroll: false
, start: function(event, ui) { , start: function(event, ui) {
$(this).fadeTo("fast", 0.5); $(this).fadeTo("fast", 0.5);
@ -379,7 +382,7 @@ console.log(parentWidth, that.$el.innerWidth(), parentHeight, that.$el, parentEl
$(this) $(this)
.closest("tr") .closest("tr")
.clone() .clone()
.css($(this).getStyleObject()) //.css($(this).getStyleObject())
.addClass("selected") .addClass("selected")
) )
.parent() .parent()

@ -90,13 +90,13 @@ _
$(event.target).parents("ul:first").find("> li:first-child").addClass("selected"); $(event.target).parents("ul:first").find("> li:first-child").addClass("selected");
}, 10); }, 10);
}); });
/*
$(TableTools.fnGetInstance("DataTables_Table_0").fnGetSelected()).draggable({scope: "list-item",helper: function () { return $('<div class="drag-table-item"><table></table></div>').find('table').append($(event.target).closest('tr').clone()).end().insertBefore("body > .ui-layout-west").appendTo("body");}});
*/
this.$el.find("> ul > li:first > span").droppable({ this.$el.find("> ul > li:first > span").droppable({
activeClass: "droppable" activeClass: "droppable"
, hoverClass: "droppable-hover"
, scope: "list-item" , scope: "list-item"
, tolerance: "touch" // We really need this cause our items are much bigger than the droppable , tolerance: "touch" // We really need this cause our items
// are much bigger than the droppable
, drop: that._addPlaylistItem , drop: that._addPlaylistItem
}); });
} }

Loading…
Cancel
Save