[D4Science Infrastructure - Incident #393] Share Updates: users tagging does not work in Firefox
git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portlets/user/share-updates@117300 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
3e72d59d1c
commit
3943cd1df1
|
@ -16,6 +16,8 @@ import org.gcube.portlets.widgets.pickitem.shared.ItemBean;
|
|||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.Element;
|
||||
import com.google.gwt.event.dom.client.KeyCodes;
|
||||
import com.google.gwt.event.dom.client.KeyPressEvent;
|
||||
import com.google.gwt.event.dom.client.KeyPressHandler;
|
||||
import com.google.gwt.event.shared.HandlerManager;
|
||||
import com.google.gwt.user.client.DOM;
|
||||
import com.google.gwt.user.client.Event;
|
||||
|
@ -45,7 +47,7 @@ public class SuperPosedTextArea extends TextArea {
|
|||
*/
|
||||
public SuperPosedTextArea() {
|
||||
sinkEvents(Event.ONPASTE);
|
||||
sinkEvents(Event.ONKEYPRESS);
|
||||
//sinkEvents(Event.ONKEYPRESS);
|
||||
sinkEvents(Event.ONCONTEXTMENU);
|
||||
sinkEvents(Event.ONKEYDOWN);
|
||||
sinkEvents(Event.ONKEYUP);
|
||||
|
@ -74,6 +76,15 @@ public class SuperPosedTextArea extends TextArea {
|
|||
|
||||
getElement().setAttribute("id", "postTextArea");
|
||||
bind();
|
||||
|
||||
this.addKeyPressHandler(new KeyPressHandler() {
|
||||
@Override
|
||||
public void onKeyPress(KeyPressEvent event) {
|
||||
pickUserDlg.onKeyPress(getCursorPos(), event.getUnicodeCharCode(), getAbsoluteLeft(), getAbsoluteTop()+getOffsetHeight(), getText());
|
||||
pickHashtagDlg.onKeyPress(getCursorPos(), event.getUnicodeCharCode(), getAbsoluteLeft(), getAbsoluteTop()+getOffsetHeight(), getText());
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -102,11 +113,6 @@ public class SuperPosedTextArea extends TextArea {
|
|||
t.schedule(100);
|
||||
break;
|
||||
}
|
||||
case Event.ONKEYPRESS: {
|
||||
pickUserDlg.onKeyPress(this.getCursorPos(), event.getKeyCode(), this.getAbsoluteLeft(), this.getAbsoluteTop()+this.getOffsetHeight(), getText());
|
||||
pickHashtagDlg.onKeyPress(this.getCursorPos(), event.getKeyCode(), this.getAbsoluteLeft(), this.getAbsoluteTop()+this.getOffsetHeight(), getText());
|
||||
break;
|
||||
}
|
||||
case Event.ONKEYUP: {
|
||||
injectInDiv(getText());
|
||||
pickUserDlg.onKeyUp(event.getKeyCode());
|
||||
|
@ -149,7 +155,7 @@ public class SuperPosedTextArea extends TextArea {
|
|||
DOM.getElementById("highlighter").setInnerHTML("");
|
||||
}
|
||||
private void injectInDiv(String textAreaText) {
|
||||
GWT.log("# injectInDiv: "+textAreaText);
|
||||
//GWT.log("# injectInDiv: "+textAreaText);
|
||||
String text;
|
||||
// parse the text:
|
||||
// replace all the line breaks by <br/>, and all the double spaces by the html version
|
||||
|
|
Loading…
Reference in New Issue