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:
parent
b5d0bd78ab
commit
eab61be60a
|
@ -59,6 +59,18 @@ public class MultipleDNDUpload extends LayoutPanel implements
|
||||||
// .setWindow(ScriptInjector.TOP_WINDOW).inject();
|
// .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
|
* Adds the unique container. You must add a unique panel in order to DND
|
||||||
* works fine.
|
* works fine.
|
||||||
|
@ -75,7 +87,7 @@ public class MultipleDNDUpload extends LayoutPanel implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onlyChild = w;
|
onlyChild = w;
|
||||||
onlyChild.getElement().setId("drop_target_only_child");
|
// onlyChild.getElement().setId("drop_target_only_child");
|
||||||
super.add(onlyChild);
|
super.add(onlyChild);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,7 +112,12 @@ public class MultipleDNDUpload extends LayoutPanel implements
|
||||||
*/
|
*/
|
||||||
public void setVisibleOnlyChild(boolean bool) {
|
public void setVisibleOnlyChild(boolean bool) {
|
||||||
if (onlyChild != null) {
|
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";
|
drop.className = "over-false";
|
||||||
$wnd.$('#drop_target_inner')[0].className = "";
|
$wnd.$('#drop_target_inner')[0].className = "";
|
||||||
$wnd.$('#drop_target_outer')[0].style.display = "none";
|
$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::setVisibleOnlyChild(Z)(true);
|
||||||
}-*/;
|
}-*/;
|
||||||
|
|
||||||
|
@ -336,6 +354,7 @@ public class MultipleDNDUpload extends LayoutPanel implements
|
||||||
console.log("before load");
|
console.log("before load");
|
||||||
var drop = $wnd.$('#drop_target')[0];
|
var drop = $wnd.$('#drop_target')[0];
|
||||||
$wnd.$('#drop_target_outer')[0].style.display = "none";
|
$wnd.$('#drop_target_outer')[0].style.display = "none";
|
||||||
|
|
||||||
console.log("drop is " + drop);
|
console.log("drop is " + drop);
|
||||||
|
|
||||||
function cancel(e) {
|
function cancel(e) {
|
||||||
|
@ -384,7 +403,9 @@ public class MultipleDNDUpload extends LayoutPanel implements
|
||||||
console.log('dragenter');
|
console.log('dragenter');
|
||||||
drop.className = "over-true";
|
drop.className = "over-true";
|
||||||
$wnd.$('#drop_target_inner')[0].className = "";
|
$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);
|
instance.@org.gcube.portlets.widgets.workspaceuploader.client.uploader.dragdrop.MultipleDNDUpload::setVisibleOnlyChild(Z)(false);
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (containsFiles(e)) {
|
if (containsFiles(e)) {
|
||||||
console.log("The drag event contains files");
|
console.log("The drag event contains files");
|
||||||
|
@ -406,6 +427,7 @@ public class MultipleDNDUpload extends LayoutPanel implements
|
||||||
drop.className = "over-false";
|
drop.className = "over-false";
|
||||||
$wnd.$('#drop_target_inner')[0].className = "";
|
$wnd.$('#drop_target_inner')[0].className = "";
|
||||||
$wnd.$('#drop_target_outer')[0].style.display = "none";
|
$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::setVisibleOnlyChild(Z)(true);
|
||||||
instance.@org.gcube.portlets.widgets.workspaceuploader.client.uploader.dragdrop.MultipleDNDUpload::setLimitExceeded(Z)(false);
|
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');
|
console.log('dragover');
|
||||||
drop.className = "over-true";
|
drop.className = "over-true";
|
||||||
$wnd.$('#drop_target_outer')[0].style.display = "inline";
|
$wnd.$('#drop_target_outer')[0].style.display = "inline";
|
||||||
|
// $wnd.$('#drop_target_only_child')[0].style.display = "none";
|
||||||
});
|
});
|
||||||
|
|
||||||
addEventHandler(
|
addEventHandler(
|
||||||
|
|
Loading…
Reference in New Issue