Skip to content

Commit

Permalink
Fix drag issue
Browse files Browse the repository at this point in the history
  • Loading branch information
asika32764 committed Mar 26, 2017
1 parent b07c967 commit c63ade0
Showing 1 changed file with 11 additions and 3 deletions.
Expand Up @@ -68,14 +68,14 @@
);

$token = JSession::getFormToken();
$text = JText::_('COM_INSTALLER_DRAG_FILE_HERE');

// Drag-drop installation
JFactory::getDocument()->addScriptDeclaration(
<<<JS
jQuery(document).ready(function($) {
var body = $('body');
var cover = $('#dragarea');
var form = document.getElementById("adminForm");
body.on('dragenter', function(e) {
e.stopPropagation();
Expand All @@ -91,6 +91,13 @@
return false;
});
cover.on('dragleave', function(e) {
e.preventDefault();
cover.fadeOut();
return false;
});
body.on('drop', function(event) {
event.preventDefault();
Expand Down Expand Up @@ -150,7 +157,8 @@
overflow: hidden;
}
#dragarea .dragarea-title {
#dragarea::before {
content: "{$text}";
width: 100%;
display: block;
font-size: 36px;
Expand Down Expand Up @@ -244,5 +252,5 @@
</div>
<div id="loading"></div>
<div id="dragarea" style="display: none;">
<div class="dragarea-title"><?php echo JText::_('COM_INSTALLER_DRAG_FILE_HERE'); ?></div>

</div>

0 comments on commit c63ade0

Please sign in to comment.