Fixed attach button behaviour while uploading a file.
git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portlets/user/share-updates@122591 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
d44e9a2bd5
commit
f52cd6a6a6
|
@ -4,12 +4,6 @@
|
||||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
|
||||||
<dependent-module archiveName="gcube-widgets-1.9.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gcube-widgets/gcube-widgets">
|
|
||||||
<dependency-type>uses</dependency-type>
|
|
||||||
</dependent-module>
|
|
||||||
<dependent-module archiveName="pickitem-widget-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/pickitem-widget/pickitem-widget">
|
|
||||||
<dependency-type>uses</dependency-type>
|
|
||||||
</dependent-module>
|
|
||||||
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
|
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
|
||||||
<property name="context-root" value="share-updates"/>
|
<property name="context-root" value="share-updates"/>
|
||||||
</wb-module>
|
</wb-module>
|
||||||
|
|
|
@ -30,6 +30,8 @@ import com.google.gwt.dom.client.Style.Display;
|
||||||
import com.google.gwt.dom.client.Style.FontWeight;
|
import com.google.gwt.dom.client.Style.FontWeight;
|
||||||
import com.google.gwt.dom.client.Style.Unit;
|
import com.google.gwt.dom.client.Style.Unit;
|
||||||
import com.google.gwt.dom.client.Style.Visibility;
|
import com.google.gwt.dom.client.Style.Visibility;
|
||||||
|
import com.google.gwt.event.dom.client.ChangeEvent;
|
||||||
|
import com.google.gwt.event.dom.client.ChangeHandler;
|
||||||
import com.google.gwt.event.dom.client.ClickEvent;
|
import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
import com.google.gwt.event.dom.client.DragLeaveEvent;
|
import com.google.gwt.event.dom.client.DragLeaveEvent;
|
||||||
import com.google.gwt.event.dom.client.DragLeaveHandler;
|
import com.google.gwt.event.dom.client.DragLeaveHandler;
|
||||||
|
@ -307,21 +309,23 @@ public class ShareUpdateForm extends Composite {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if an upload is already running
|
|
||||||
if(uploadProgress.isVisible()){
|
|
||||||
|
|
||||||
Window.alert(WAIT_CURRENT_UPLOAD_FINISHING);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// proceed with the upload
|
// proceed with the upload
|
||||||
FileUpload up = uploadProgress.initialize();
|
FileUpload up = uploadProgress.initialize();
|
||||||
up.setVisible(false);
|
|
||||||
uploadProgress.setVisible(true);
|
|
||||||
|
|
||||||
// open the fileupload
|
|
||||||
up.click();
|
up.click();
|
||||||
|
up.setVisible(false);
|
||||||
|
|
||||||
|
// disable attach button when users select a file
|
||||||
|
up.addChangeHandler(new ChangeHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onChange(ChangeEvent event) {
|
||||||
|
attachButton.setEnabled(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
uploadProgress.setVisible(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@UiHandler("submitButton")
|
@UiHandler("submitButton")
|
||||||
|
@ -638,10 +642,6 @@ public class ShareUpdateForm extends Composite {
|
||||||
|
|
||||||
// create temp view of the attached file and add to the previewer
|
// create temp view of the attached file and add to the previewer
|
||||||
final AttachmentPreviewer atPrev = new AttachmentPreviewer(fileName, attachedDefaultImageUrl, preview, this);
|
final AttachmentPreviewer atPrev = new AttachmentPreviewer(fileName, attachedDefaultImageUrl, preview, this);
|
||||||
//preview.add(atPrev);
|
|
||||||
|
|
||||||
// disable the submit button till we know the result of the upload process
|
|
||||||
submitButton.setEnabled(false);
|
|
||||||
|
|
||||||
shareupdateService.checkUploadedFile(fileName, absolutePathOnServer, new AsyncCallback<LinkPreview>() {
|
shareupdateService.checkUploadedFile(fileName, absolutePathOnServer, new AsyncCallback<LinkPreview>() {
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
|
Loading…
Reference in New Issue