0
如何处理“弹出式窗口”之外的点击事件,实际上是使用LinkedIn Hopscotch包装器进行GWT。这个想法是当用户点击弹出窗口之外(即在.hopscotch-bubble-container
之外)弹出窗口应该隐藏。调用GwtTour.endTour(false);
最终会导致弹出窗口隐藏。这很好,但是,当“dashboardLink”菜单项也被点击时我也需要制作;这个$(“html”)。bind(“click”,...)也不应该被调用。它被称为,不知道为什么。处理弹出式窗口外的单击事件
代码:
private void bindHandlers(){
// Handle when click event came from here
$(".hopscotch-bubble-container").bind("click", new com.google.gwt.query.client.Function() {
@Override
public boolean f(com.google.gwt.user.client.Event e) {
e.stopPropagation();
return false;
}
});
$("#dashboardLink").bind("click", new com.google.gwt.query.client.Function() {
@Override
public boolean f(com.google.gwt.user.client.Event e) {
e.stopPropagation();
return false;
}
});
// This event handler closes the GWT Tour
// when user click outside of it
$("html").bind("click", new com.google.gwt.query.client.Function() {
@Override
public boolean f(com.google.gwt.user.client.Event e) {
GwtTour.endTour(false);
return true;
}
});
}
你能不能只使用GWT从该对话框类“新的对话框(真)”为自动隐藏选项? – Akkusativobjekt