Sha256: 9a1dca5bfdc5617d034750e0dff877ed67cf9cf0cb52b201784d5752f3287540

Contents?: true

Size: 1.28 KB

Versions: 55

Compression:

Stored size: 1.28 KB

Contents

//= require spotlight/blocks/browse_block

SirTrevor.Blocks.SearchResults =  (function(){

  return SirTrevor.Blocks.Browse.extend({

    type: "search_results",

    icon_name: 'search_results',

    searches_key: "slug",
    view_key: "view",
    plustextable: false,

    content: function() {
      return _.template([this.items_selector()].join("<hr />\n"))(this);
    },
    
    item_options: function() {
      var block = this;
      var fields = $('[data-blacklight-configuration-search-views]').data('blacklight-configuration-search-views');

      return $.map(fields, function(field) {
        checkbox = ""
        checkbox += "<div>";
        checkbox += "<label for='" + block.formId(block.view_key + field.key) + "'>";
          checkbox += "<input id='" + block.formId(block.view_key + field.key) + "' name='" + block.view_key + "[]' type='checkbox' value='" + field.key + "' /> ";
            checkbox += field.label;
            checkbox += "</label>";
          checkbox += "</div>";
        return checkbox;
      }).join("\n");
    },

    afterPanelRender: function(data, panel) {
      $(this.inner).find('.item-input-field').attr("disabled", "disabled");
    },

    afterPanelDelete: function() {
      $(this.inner).find('.item-input-field').removeAttr("disabled");
    },

  });
})();

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
blacklight-spotlight-2.7.2 app/assets/javascripts/spotlight/blocks/search_result_block.js
blacklight-spotlight-2.7.1 app/assets/javascripts/spotlight/blocks/search_result_block.js
blacklight-spotlight-2.7.0 app/assets/javascripts/spotlight/blocks/search_result_block.js
blacklight-spotlight-2.6.1.1 app/assets/javascripts/spotlight/blocks/search_result_block.js
blacklight-spotlight-2.6.1 app/assets/javascripts/spotlight/blocks/search_result_block.js
blacklight-spotlight-2.6.0 app/assets/javascripts/spotlight/blocks/search_result_block.js
blacklight-spotlight-2.5.2 app/assets/javascripts/spotlight/blocks/search_result_block.js
blacklight-spotlight-2.5.1 app/assets/javascripts/spotlight/blocks/search_result_block.js
blacklight-spotlight-2.5.0 app/assets/javascripts/spotlight/blocks/search_result_block.js
blacklight-spotlight-2.4.1 app/assets/javascripts/spotlight/blocks/search_result_block.js
blacklight-spotlight-2.4.0 app/assets/javascripts/spotlight/blocks/search_result_block.js
blacklight-spotlight-2.3.3 app/assets/javascripts/spotlight/blocks/search_result_block.js
blacklight-spotlight-2.3.2 app/assets/javascripts/spotlight/blocks/search_result_block.js
blacklight-spotlight-2.3.1 app/assets/javascripts/spotlight/blocks/search_result_block.js
blacklight-spotlight-2.3.0 app/assets/javascripts/spotlight/blocks/search_result_block.js
blacklight-spotlight-2.2.1 app/assets/javascripts/spotlight/blocks/search_result_block.js
blacklight-spotlight-2.2.0 app/assets/javascripts/spotlight/blocks/search_result_block.js
blacklight-spotlight-2.1.0 app/assets/javascripts/spotlight/blocks/search_result_block.js
blacklight-spotlight-2.0.2 app/assets/javascripts/spotlight/blocks/search_result_block.js
blacklight-spotlight-2.0.1 app/assets/javascripts/spotlight/blocks/search_result_block.js