1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-11 05:29:28 -04:00

Ecmascript: activate link only when onClick returns true

[ Merge stuff from commit c3f17eadeb, namely
  the remaining part which changes enter() to only call activate_link when
  needed. --jonas ]
This commit is contained in:
Witold Filipczyk 2006-05-02 13:47:16 +02:00 committed by Jonas Fonseca
parent fcf8d31eba
commit 8789b7c330

View File

@ -906,7 +906,6 @@ activate_link(struct session *ses, struct document_view *doc_view,
return FRAME_EVENT_OK; return FRAME_EVENT_OK;
break; break;
case LINK_CHECKBOX: case LINK_CHECKBOX:
link_fc = get_link_form_control(link); link_fc = get_link_form_control(link);
@ -966,7 +965,6 @@ activate_link(struct session *ses, struct document_view *doc_view,
enum frame_event_status enum frame_event_status
enter(struct session *ses, struct document_view *doc_view, int do_reload) enter(struct session *ses, struct document_view *doc_view, int do_reload)
{ {
enum frame_event_status ret;
struct link *link; struct link *link;
assert(ses && doc_view && doc_view->vs && doc_view->document); assert(ses && doc_view && doc_view->vs && doc_view->document);
@ -975,12 +973,10 @@ enter(struct session *ses, struct document_view *doc_view, int do_reload)
link = get_current_link(doc_view); link = get_current_link(doc_view);
if (!link) return FRAME_EVENT_REFRESH; if (!link) return FRAME_EVENT_REFRESH;
ret = activate_link(ses, doc_view, link, do_reload);
if (ret != FRAME_EVENT_IGNORED)
if (!current_link_evhook(doc_view, SEVHOOK_ONCLICK))
return FRAME_EVENT_REFRESH;
return ret; if (!current_link_evhook(doc_view, SEVHOOK_ONCLICK))
return FRAME_EVENT_REFRESH;
return activate_link(ses, doc_view, link, do_reload);
} }
struct link * struct link *