//= require spotlight/admin/blocks/resources_block SirTrevor.Blocks.Browse = (function(){ return Spotlight.Block.Resources.extend({ type: "browse", icon_name: "browse", autocomplete_url: function() { return $(this.inner).closest('form[data-autocomplete-exhibit-searches-path]').data('autocomplete-exhibit-searches-path').replace("%25QUERY", "%QUERY"); }, autocomplete_template: function() { return '
{{#if thumbnail_image_url}}
{{/if}}{{full_title}}
  {{description}}
' }, bloodhoundOptions: function() { return { prefetch: { url: this.autocomplete_url(), ttl: 0 } }; }, _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.full_title || data.title) + '
    ', '
    ' + (data.slug || data.id) + '
    ', '
    ', '', '
    ', '
    ', '
    ', '
  • ' ].join("\n"); var panel = $(_.template(markup)(this)); var context = this; $('.remove a', 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") }, }); })();