Changes
→Complete Example
var updater = new Umlaut.HtmlUpdater( umlaut_base , ctx_object_kev );
updater.add_section_target({ umlaut_section_id: "fulltext", selector:".my_full_text" , // only show ourself if we have umlaut hits, false return from // before_update stops update. before_update: function(html, count) { return (count != 0); } });
updater.add_section_target({ umlaut_section_id: "search_inside", selector:".stuff", position: "append" });
updater.add_section_target({
position: "append",
before_update: function(container_element) {
//insert some content into the umlaut-delivered html
//before it is placed on the page
container_element.find("h3").after("<h4>We love these holdings.</h4>");
}
selector:".only_if_content",
after_update: function(updated_content, count) {
//show the ancestor DOM element with certain class, only
//if there are umlaut hits
if ( count != 0 ) {
updated_content.closest(".only_if_content").show();