/* Sir Trevor BrowseGroupCategories */ SirTrevor.Blocks.BrowseGroupCategories = (function(){ return Spotlight.Block.Resources.extend({ type: "browse_group_categories", icon_name: "browse", bloodhoundOptions: function() { var that = this; return { prefetch: { url: this.autocomplete_url(), ttl: 0, filter: function(response) { // Let the dom know that the response has been returned $(that.inner).attr('data-browse-groups-fetched', true); return response; } } }; }, autocomplete_control: function() { return '"/>'; }, autocomplete_template: function() { return '
{{title}}
' }, autocomplete_url: function() { return $(this.inner).closest('form[data-autocomplete-exhibit-browse-groups-path]').data('autocomplete-exhibit-browse-groups-path').replace("%25QUERY", "%QUERY"); }, _itemPanel: function(data) { var index = "item_" + this.globalIndex++; var checked; if (data.display == "true") { checked = "checked='checked'" } else { checked = ""; } var resource_id = data.slug || data.id; var markup = [ '
  • ', '', '', '', '
    ', '
    <%= i18n.t("blocks:resources:panel:drag") %>
    ', '
    ', '
    ', '
    ', '', '', '', '
    ', '
    ', '
    ' + data.title + '
    ', '
    ', '
    ', '', '
    ', '
    ', '
  • ' ].join("\n"); var panel = $(_.template(markup)(this)); var context = this; $('a[data-item-grid-panel-remove]', panel).on('click', function(e) { e.preventDefault(); $(this).closest('.field').remove(); context.afterPanelDelete(); }); this.afterPanelRender(data, panel); return panel; }, item_options: function() { return [ '' ].join("\n") }, }); })();