set opacity instead of visibility to fix issue on webkit

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-uploader@120247 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2015-11-10 10:31:42 +00:00
parent b5d0bd78ab
commit eab61be60a
1 changed files with 25 additions and 2 deletions

View File

@ -58,6 +58,18 @@ public class MultipleDNDUpload extends LayoutPanel implements
// ScriptInjector.fromUrl("workspaceuploader/dndhtmlfileupload.js")
// .setWindow(ScriptInjector.TOP_WINDOW).inject();
}
/* (non-Javadoc)
* @see com.google.gwt.user.client.ui.LayoutPanel#onAttach()
*/
@Override
protected void onAttach() {
super.onAttach();
if(onlyChild!=null){
onlyChild.getElement().setId("drop_target_only_child");
}
}
/**
* Adds the unique container. You must add a unique panel in order to DND
@ -75,7 +87,7 @@ public class MultipleDNDUpload extends LayoutPanel implements
}
}
onlyChild = w;
onlyChild.getElement().setId("drop_target_only_child");
// onlyChild.getElement().setId("drop_target_only_child");
super.add(onlyChild);
}
@ -100,7 +112,12 @@ public class MultipleDNDUpload extends LayoutPanel implements
*/
public void setVisibleOnlyChild(boolean bool) {
if (onlyChild != null) {
onlyChild.setVisible(bool);
GWT.log("setVisibleOnlyChild: "+bool );
// onlyChild.setVisible(bool);
if(bool)
onlyChild.getElement().getStyle().setOpacity(1.0);
else
onlyChild.getElement().getStyle().setOpacity(0.2);
}
}
@ -267,6 +284,7 @@ public class MultipleDNDUpload extends LayoutPanel implements
drop.className = "over-false";
$wnd.$('#drop_target_inner')[0].className = "";
$wnd.$('#drop_target_outer')[0].style.display = "none";
// $wnd.$('#drop_target_only_child')[0].style.display = "";
instance.@org.gcube.portlets.widgets.workspaceuploader.client.uploader.dragdrop.MultipleDNDUpload::setVisibleOnlyChild(Z)(true);
}-*/;
@ -336,6 +354,7 @@ public class MultipleDNDUpload extends LayoutPanel implements
console.log("before load");
var drop = $wnd.$('#drop_target')[0];
$wnd.$('#drop_target_outer')[0].style.display = "none";
console.log("drop is " + drop);
function cancel(e) {
@ -384,7 +403,9 @@ public class MultipleDNDUpload extends LayoutPanel implements
console.log('dragenter');
drop.className = "over-true";
$wnd.$('#drop_target_inner')[0].className = "";
// $wnd.$('#drop_target_only_child')[0].style.display = "none";
instance.@org.gcube.portlets.widgets.workspaceuploader.client.uploader.dragdrop.MultipleDNDUpload::setVisibleOnlyChild(Z)(false);
e.preventDefault();
if (containsFiles(e)) {
console.log("The drag event contains files");
@ -406,6 +427,7 @@ public class MultipleDNDUpload extends LayoutPanel implements
drop.className = "over-false";
$wnd.$('#drop_target_inner')[0].className = "";
$wnd.$('#drop_target_outer')[0].style.display = "none";
// $wnd.$('#drop_target_only_child')[0].style.display = "";
instance.@org.gcube.portlets.widgets.workspaceuploader.client.uploader.dragdrop.MultipleDNDUpload::setVisibleOnlyChild(Z)(true);
instance.@org.gcube.portlets.widgets.workspaceuploader.client.uploader.dragdrop.MultipleDNDUpload::setLimitExceeded(Z)(false);
});
@ -418,6 +440,7 @@ public class MultipleDNDUpload extends LayoutPanel implements
console.log('dragover');
drop.className = "over-true";
$wnd.$('#drop_target_outer')[0].style.display = "inline";
// $wnd.$('#drop_target_only_child')[0].style.display = "none";
});
addEventHandler(