mirror of
https://github.com/rkd77/elinks.git
synced 2024-08-22 21:14:32 -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:
parent
fcf8d31eba
commit
8789b7c330
@ -906,7 +906,6 @@ activate_link(struct session *ses, struct document_view *doc_view,
|
||||
return FRAME_EVENT_OK;
|
||||
|
||||
break;
|
||||
|
||||
case LINK_CHECKBOX:
|
||||
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
|
||||
enter(struct session *ses, struct document_view *doc_view, int do_reload)
|
||||
{
|
||||
enum frame_event_status ret;
|
||||
struct link *link;
|
||||
|
||||
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);
|
||||
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 *
|
||||
|
Loading…
Reference in New Issue
Block a user