minor fix and moved to 1.1.1 version (now loading image is removed after that the orientation has been retrieved from the server side)
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/widgets/image-previewer-widget@130977 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
8cbed3e7cd
commit
b25cac6a72
|
@ -1,4 +1,7 @@
|
|||
<ReleaseNotes>
|
||||
<Changeset component="org.gcube.portlets-widgets.image-previewer-widget.1-1-1" date="2016-11-02">
|
||||
<Change>Minor fix</Change>
|
||||
</Changeset>
|
||||
<Changeset component="org.gcube.portlets-widgets.image-previewer-widget.1-1-0" date="2016-04-02">
|
||||
<Change>Removed GWT Standard css</Change>
|
||||
<Change>Style changes</Change>
|
||||
|
|
3
pom.xml
3
pom.xml
|
@ -12,8 +12,7 @@
|
|||
|
||||
<groupId>org.gcube.portlets.widgets</groupId>
|
||||
<artifactId>image-previewer-widget</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.1.0-SNAPSHOT</version>
|
||||
<version>1.1.1-SNAPSHOT</version>
|
||||
<name>gCube Image previewer widget</name>
|
||||
<description>
|
||||
gCube Image Previewer widget is a GWT Widget that can be used to show a preview of one or more images
|
||||
|
|
|
@ -333,7 +333,13 @@ public class Carousel extends Composite{
|
|||
shownImage.setVisible(false);
|
||||
|
||||
final EnhancedImage imageToShow = listOfAttachmentsToShow.get(index);
|
||||
String url = imageToShow.getImageUrl();
|
||||
final String url = imageToShow.getImageUrl();
|
||||
|
||||
// when image is downloaded ...
|
||||
shownImage.addLoadHandler(new LoadHandler() {
|
||||
|
||||
@Override
|
||||
public void onLoad(LoadEvent event) {
|
||||
|
||||
// call only if undefined
|
||||
if(imageToShow.getOrientation().equals(Orientation.UNDEFINED)){
|
||||
|
@ -343,27 +349,20 @@ public class Carousel extends Composite{
|
|||
@Override
|
||||
public void onSuccess(Orientation result) {
|
||||
setOrientation(imageToShow, result);
|
||||
removeLoader();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
setOrientation(imageToShow, Orientation.DO_NOT_ROTATE);
|
||||
removeLoader();
|
||||
}
|
||||
});
|
||||
|
||||
}else
|
||||
}else{
|
||||
setOrientation(imageToShow, imageToShow.getOrientation());
|
||||
|
||||
// when image is downloaded ...
|
||||
shownImage.addLoadHandler(new LoadHandler() {
|
||||
|
||||
@Override
|
||||
public void onLoad(LoadEvent event) {
|
||||
|
||||
// swap
|
||||
shownImage.setVisible(true);
|
||||
loadingImage.setVisible(false);
|
||||
|
||||
removeLoader();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -388,6 +387,14 @@ public class Carousel extends Composite{
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Remove image loader
|
||||
*/
|
||||
protected void removeLoader() {
|
||||
shownImage.setVisible(true);
|
||||
loadingImage.setVisible(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the orientation
|
||||
* @param img
|
||||
|
|
Loading…
Reference in New Issue