Fixes bug where droppable colour sticks
This commit is contained in:
parent
da7515e230
commit
0697584108
|
|
@ -167,26 +167,18 @@
|
|||
}
|
||||
|
||||
function finishDrag() {
|
||||
|
||||
// Dragged back to original position
|
||||
if (collision($clone, $el)) {
|
||||
// Do nothing
|
||||
}
|
||||
// Dragged to the code editor
|
||||
else if (collision($clone, $editorArea)) {
|
||||
|
||||
if (collision($clone, $editorArea)) {
|
||||
// Add the component to the page
|
||||
$el.click()
|
||||
|
||||
// Can only attach to page or layouts
|
||||
if (!$componentList.length || !$editor)
|
||||
return
|
||||
|
||||
// Inject {% component %} tag
|
||||
var alias = $('input[name="component_aliases[]"]', $el).val()
|
||||
$editor.insert("{% component '" + alias + "' %}")
|
||||
if ($componentList.length && $editor) {
|
||||
// Inject {% component %} tag
|
||||
var alias = $('input[name="component_aliases[]"]', $el).val()
|
||||
$editor.insert("{% component '" + alias + "' %}")
|
||||
}
|
||||
}
|
||||
|
||||
// Dragged to the component list
|
||||
else if (collision($clone, $componentList)) {
|
||||
// Add the component to the page
|
||||
|
|
@ -197,6 +189,10 @@
|
|||
$editor.removeAllListeners('mousemove')
|
||||
$editor.blur()
|
||||
}
|
||||
|
||||
if ($componentList.length) {
|
||||
$componentList.removeClass('droppable')
|
||||
}
|
||||
}
|
||||
|
||||
function collision($div1, $div2) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue