Comment 1 for bug 1538675

Revision history for this message
Jeff Davis (jdavis-sitka) wrote :

If I understand correctly, we use an onchange event handler to make catalog links work within the web client. Clicking a link in the catalog iframe triggers onchange, which calls the handle_page function, which intercepts the click and loads the appropriate staff client page. But opening a link in a new tab/window appears to bypass the event handler.

Generally, you open a link in a new tab/window via the context menu. So I wonder if we could modify the opac_iframe DOM (or add some ctx.is_staff code to the appropriate OPAC templates??) so that, for links matching certain patterns, invoking the context menu would display a custom menu with appropriate actions for that link pattern. For example, right-clicking a link of the form /opac/record/(\d+)/ would display a menu with an option "View record in new tab", which loads /staff/cat/catalog/record/$1 in a new tab.

The handle_page function already does pattern matching on links within opac_iframe, and the client accesses opac_iframe.dom.contentWindow for stuff like search result hit counts, so hopefully it's not a completely crazy idea. :)