|
|
|
@ -66,6 +66,16 @@ public class AddCommentTemplate extends Composite {
|
|
|
|
|
cancelButton.setVisible(false);
|
|
|
|
|
commentTextArea.setHeight("30px");
|
|
|
|
|
commentTextArea.setContext(owner.getVREContext());
|
|
|
|
|
|
|
|
|
|
// 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 = commentTextArea.getText();
|
|
|
|
|
if(!currentText.isEmpty()){
|
|
|
|
|
closingEvent.setMessage("Do you really want to leave the page?");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* called on edit comment
|
|
|
|
@ -93,12 +103,23 @@ public class AddCommentTemplate extends Composite {
|
|
|
|
|
mainPanel.setStyleName("single-comment");
|
|
|
|
|
commentTextArea.addStyleName("comment-dark-color");
|
|
|
|
|
submitButton.setText("Edit");
|
|
|
|
|
|
|
|
|
|
// 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 = commentTextArea.getText();
|
|
|
|
|
if(!currentText.isEmpty()){
|
|
|
|
|
closingEvent.setMessage("Do you really want to leave the page?");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Used by AddCommentTemplate to instantiate SuperPosedTextArea */
|
|
|
|
|
@UiFactory SuperPosedTextArea build() {
|
|
|
|
|
return new SuperPosedTextArea(highlighterDIV);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setFocus() {
|
|
|
|
|
commentTextArea.setFocus(true);
|
|
|
|
|
submitButton.setVisible(true);
|
|
|
|
|