Sha256: cb97e94ec8506ab70a05fff893e869836c202eab76d3be592f2a2b352c565fba

Contents?: true

Size: 1.25 KB

Versions: 39

Compression:

Stored size: 1.25 KB

Contents

//= require spotlight/blocks/solr_documents_block

SirTrevor.Blocks.SolrDocumentsFeatures = (function(){

  return SirTrevor.Blocks.SolrDocuments.extend({
    textable: false,
    type: "solr_documents_features",

    icon_name: "item_features",
    
    afterPreviewLoad: function(options) {
      this.$el.find('.carousel').carousel();

      // the bootstrap carousel only initializes data-slide widgets on page load, so we need
      // to initialize them ourselves..
      var clickHandler = function (e) {
        var href
        var $this   = $(this)
        var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
        if (!$target.hasClass('carousel')) return
        var options = $.extend({}, $target.data(), $this.data())
        var slideIndex = $this.attr('data-slide-to')
        if (slideIndex) options.interval = false

        $.fn.carousel.call($target, options)

        if (slideIndex) {
          $target.data('bs.carousel').to(slideIndex)
        }

        e.preventDefault()
      }

      this.$el.find('.carousel')
        .on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
        .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
    }

  });

})();

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
blacklight-spotlight-0.24.0 app/assets/javascripts/spotlight/blocks/solr_documents_features_block.js
blacklight-spotlight-0.23.0 app/assets/javascripts/spotlight/blocks/solr_documents_features_block.js
blacklight-spotlight-0.22.0 app/assets/javascripts/spotlight/blocks/solr_documents_features_block.js
blacklight-spotlight-0.21.0 app/assets/javascripts/spotlight/blocks/solr_documents_features_block.js
blacklight-spotlight-0.20.3 app/assets/javascripts/spotlight/blocks/solr_documents_features_block.js
blacklight-spotlight-0.20.2 app/assets/javascripts/spotlight/blocks/solr_documents_features_block.js
blacklight-spotlight-0.20.1 app/assets/javascripts/spotlight/blocks/solr_documents_features_block.js
blacklight-spotlight-0.20.0 app/assets/javascripts/spotlight/blocks/solr_documents_features_block.js
blacklight-spotlight-0.19.2 app/assets/javascripts/spotlight/blocks/solr_documents_features_block.js
blacklight-spotlight-0.19.1 app/assets/javascripts/spotlight/blocks/solr_documents_features_block.js
blacklight-spotlight-0.19.0 app/assets/javascripts/spotlight/blocks/solr_documents_features_block.js
blacklight-spotlight-0.18.0 app/assets/javascripts/spotlight/blocks/solr_documents_features_block.js
blacklight-spotlight-0.17.1 app/assets/javascripts/spotlight/blocks/solr_documents_features_block.js
blacklight-spotlight-0.17.0 app/assets/javascripts/spotlight/blocks/solr_documents_features_block.js
blacklight-spotlight-0.16.0 app/assets/javascripts/spotlight/blocks/solr_documents_features_block.js
blacklight-spotlight-0.15.0 app/assets/javascripts/spotlight/blocks/solr_documents_features_block.js
blacklight-spotlight-0.14.2 app/assets/javascripts/spotlight/blocks/solr_documents_features_block.js
blacklight-spotlight-0.14.1 app/assets/javascripts/spotlight/blocks/solr_documents_features_block.js
blacklight-spotlight-0.14.0 app/assets/javascripts/spotlight/blocks/solr_documents_features_block.js
blacklight-spotlight-0.13.0 app/assets/javascripts/spotlight/blocks/solr_documents_features_block.js