omni search client library dependency | Community
Skip to main content
New Participant
June 7, 2018
Solved

omni search client library dependency

  • June 7, 2018
  • 1 reply
  • 1918 views

We have a new button in the global nav which has a class assigned using granite:rel. We have a Client Library javascript code which listens to the click event for that button and calls the our javascript. In our javscript ClientLib, we have assigned the categories as - dam.gui.coral.metadataeditor,granite.ui.coral.foundation so that our javascript function gets call when these categories are loaded on the page. This call works fine when we are browsing the DAM assets. However when we do the omnisearch even though our button is available in the global nav through overlay, but the java script is not available when we click onto the button.

We are wondering what dependencies we should be adding so that our custom javascript file is available for omni search as well. We tried adding several search related dependencies but no luck.   If this is not possible then what options do we have so that we can inject and make our javascript file for the omni search.

Any help will be great. Thanks.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by vsharm

We found that our element was getting loaded after the java script loaded and that is why it was not working.  So instead of binding the event on the element like

$(".my_button_class").click(function() {...

we had to do like -

$(document).on('click',"my_button_class", function()) {...

and this has fixed the issue.

1 reply

vsharmAuthorAccepted solution
New Participant
June 8, 2018

We found that our element was getting loaded after the java script loaded and that is why it was not working.  So instead of binding the event on the element like

$(".my_button_class").click(function() {...

we had to do like -

$(document).on('click',"my_button_class", function()) {...

and this has fixed the issue.