Added onWindowClosingHandler to alert users who didn't commit changes
git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portlets/user/share-updates@128566 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
209a86a4e6
commit
01a9f8277a
|
@ -277,6 +277,16 @@ public class ShareUpdateForm extends Composite {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// add onWindowClosing handler to alert the user who didn't share post if really wants to leave
|
||||||
|
Window.addWindowClosingHandler(new Window.ClosingHandler() {
|
||||||
|
public void onWindowClosing(Window.ClosingEvent closingEvent) {
|
||||||
|
String currentText = shareTextArea.getText();
|
||||||
|
if(!currentText.isEmpty()){
|
||||||
|
closingEvent.setMessage("Do you really want to leave the page?");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1057,23 +1067,23 @@ public class ShareUpdateForm extends Composite {
|
||||||
instance.@org.gcube.portlets.user.shareupdates.client.view.ShareUpdateForm::showAlert(Ljava/lang/String;)(msg);
|
instance.@org.gcube.portlets.user.shareupdates.client.view.ShareUpdateForm::showAlert(Ljava/lang/String;)(msg);
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
var msg = numberIgnoredFiles + ignoredFilesAlert;
|
var msg = numberIgnoredFiles + ignoredFilesAlert;
|
||||||
console.log(msg);
|
console.log(msg);
|
||||||
instance.@org.gcube.portlets.user.shareupdates.client.view.ShareUpdateForm::showAlert(Ljava/lang/String;)(msg);
|
instance.@org.gcube.portlets.user.shareupdates.client.view.ShareUpdateForm::showAlert(Ljava/lang/String;)(msg);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// reset text area
|
// reset text area
|
||||||
instance.@org.gcube.portlets.user.shareupdates.client.view.ShareUpdateForm::resetDNDStyleEffects()();
|
instance.@org.gcube.portlets.user.shareupdates.client.view.ShareUpdateForm::resetDNDStyleEffects()();
|
||||||
|
|
||||||
// enable attach buttons
|
// enable attach buttons
|
||||||
instance.@org.gcube.portlets.user.shareupdates.client.view.ShareUpdateForm::enableAttachButtons(Z)(true);
|
instance.@org.gcube.portlets.user.shareupdates.client.view.ShareUpdateForm::enableAttachButtons(Z)(true);
|
||||||
|
|
||||||
// enable submit buttons
|
// enable submit buttons
|
||||||
instance.@org.gcube.portlets.user.shareupdates.client.view.ShareUpdateForm::enableSubmitButtons(Z)(true);
|
instance.@org.gcube.portlets.user.shareupdates.client.view.ShareUpdateForm::enableSubmitButtons(Z)(true);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}-*/;
|
}-*/;
|
||||||
|
|
Loading…
Reference in New Issue