define("collectionfilter",["jquery","pat-base","mockup-patterns-contentloader"],function(t,e,o){return e.extend({name:"collectionfilter",trigger:".pat-collectionfilter",parser:"mockup",contentloader:o,defaults:{collectionUUID:"",collectionURL:"",reloadURL:"",contentSelector:"#content-core"},init:function(){if(this.$el.unbind("collectionfilter:reload"),this.$el.on("collectionfilter:reload",function(t,e){e.noReloadSearch&&this.$el.hasClass("collectionSearch")||e.collectionUUID===this.options.collectionUUID&&this.reload(e.targetFilterURL)}.bind(this)),this.$el.hasClass("collectionSearch")){t('button[type="submit"]',this.$el).hide(),t("form",this.$el).on("submit",function(t){t.preventDefault()});var e;t('input[name="SearchableText"]',this.$el).on("keyup",function(o){clearTimeout(e),e=setTimeout(function(){var e=t(o.target).data("url"),i=encodeURIComponent(t(o.target).val());e+="&"+t(o.target).attr("name")+"="+i,t(this.trigger).trigger("collectionfilter:reload",{collectionUUID:this.options.collectionUUID,targetFilterURL:e,noReloadSearch:!0}),this.reloadCollection(e)}.bind(this),500)}.bind(this))}else t(".filterContent a",this.$el).on("click",function(e){e.stopPropagation(),e.preventDefault();var o=t(e.target).closest("a").attr("href");t(this.trigger).trigger("collectionfilter:reload",{collectionUUID:this.options.collectionUUID,targetFilterURL:o}),this.reloadCollection(o)}.bind(this)),t(".filterContent input",this.$el).on("change",function(e){var o=t(e.target).data("url");t(this.trigger).trigger("collectionfilter:reload",{collectionUUID:this.options.collectionUUID,targetFilterURL:o}),this.reloadCollection(o)}.bind(this)),t(".filterContent select",this.$el).on("change",function(e){var o=t("option:selected",e.target),i=t(o).data("url");t(this.trigger).trigger("collectionfilter:reload",{collectionUUID:this.options.collectionUUID,targetFilterURL:i}),this.reloadCollection(i)}.bind(this))},reload:function(t){var e=this.options.reloadURL,o=e.split("?"),i=o[1]||[],n=t.split("?")[1]||[],l=[].concat(i,n).join("&");e=[].concat(o[0],l).join("?");new this.contentloader(this.$el,{url:e,target:this.$el,content:"aside",trigger:"immediate"})},reloadCollection:function(e){new this.contentloader(t(this.options.contentSelector).parent(),{url:e+"&ajax_load=1",target:this.options.contentSelector,content:this.options.contentSelector,trigger:"immediate"});re=/@@.*\//,e=e.replace(re,""),window.history.replaceState({path:e},"",e)}})}),require(["jquery","pat-registry","collectionfilter"],function(t,e){"use strict";window.parent===window&&t(document).ready(function(){e.initialized||e.init()})}),define("/Users/peter/workspace/phonogen2018/srcaddons/collective.collectionfilter/src/collective/collectionfilter/resources/collectionfilter-bundle.js",function(){});
//# sourceMappingURL=collectionfilter-bundle-compiled.js.map