Skip to content

Commit

Permalink
SAKIII-4971 Dragging and dropping onto a row can cause hover state to…
Browse files Browse the repository at this point in the history
… stay
  • Loading branch information
Bert Pareyn committed Feb 17, 2012
1 parent 8cc2c1b commit 0b925b6
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions devwidgets/contentauthoring/javascript/contentauthoring.js
Expand Up @@ -1109,35 +1109,30 @@ require(["jquery", "sakai/sakai.api.core", "jquery-ui"], function($, sakai) {
////////////////////////////
////////////////////////////

// Highlight on drag entering drop zone.
$(".contentauthoring_cell_element, .contentauthoring_cell_content", $rootel).live('dragenter', function(ev) {
$(".contentauthoring_row_reorder_highlight.external_content", $rootel).remove();
if($(this).hasClass("contentauthoring_cell_element")){
$(this).after($("<div class='contentauthoring_row_reorder_highlight external_content'></div>"));
} else {
$(this).append($("<div class='contentauthoring_row_reorder_highlight external_content'></div>"));
}
return false;
});

// Un-highlight on drag leaving drop zone.
$(".contentauthoring_cell_element, .contentauthoring_cell_content", $rootel).live('dragleave', function(ev) {
$(".contentauthoring_cell_element", $rootel).live('dragleave', function(ev) {
$(".contentauthoring_row_reorder_highlight.external_content", $rootel).remove();
return false;
});

// Decide whether the thing dragged in is welcome.
$(".contentauthoring_cell_element, .contentauthoring_cell_content", $rootel).live('dragover', function(ev) {
$(".contentauthoring_cell_element, .contentauthoring_cell_content, .contentauthoring_row_reorder_highlight", $rootel).live('dragover', function(ev) {
$(".contentauthoring_row_reorder_highlight.external_content", $rootel).remove();
if($(this).hasClass("contentauthoring_cell_element")){
$(this).after($("<div class='contentauthoring_row_reorder_highlight external_content'></div>"));
} else {
$(this).append($("<div class='contentauthoring_row_reorder_highlight external_content'></div>"));
}
return false;
});

// Handle the final drop
$(".contentauthoring_cell_element,.contentauthoring_cell_content", $rootel).live('drop', function(ev) {
$(".contentauthoring_cell_element, .contentauthoring_cell_content", $rootel).live('drop', function(ev) {
ev.preventDefault();
$(".contentauthoring_row_reorder_highlight.external_content", $rootel).remove();
if(!$(this).hasClass("contentauthoring_cell_element")){
var dt = ev.originalEvent.dataTransfer;
addExternal(ev, $(this));
}
return false;
});

Expand Down

0 comments on commit 0b925b6

Please sign in to comment.