{I" class:ETI"BundledAsset; FI"logical_path; TI"+spotlight/blocks/multi_up_item_grid.js; FI" pathname; TI"g/Users/cabeer/Projects/sul/spotlight/app/assets/javascripts/spotlight/blocks/multi_up_item_grid.js; FI"content_type; TI"application/javascript; TI" mtime; Tl+Ť¾TI"length; Ti<'I"digest; TI"%2fc989b172ac46b795768f51914ae563; FI"source; TI"<'/* Sir Trevor MutliUpItemGrid Block. This block takes an ID, fetches the record from solr, displays the image, title, and any provided text and displays them. */ SirTrevor.Blocks.MultiUpItemGrid = (function(){ return Spotlight.Block.extend({ key: "item-grid", id_key: "item-grid-id", display_checkbox: "item-grid-display", panel: 'typeahead-panel', thumbnail_key: 'item-grid-thumbnail', primary_field_key: "item-grid-primary-caption-field", show_primary_caption: "show-primary-caption", secondary_field_key: "item-grid-secondary-caption-field", show_secondary_caption: "show-secondary-caption", auto_play_images_key: "auto-play-images", auto_play_images_interval_key: "auto-play-images-interval", max_height_key: "max-height", title_key: "spotlight_title_field", type: "multi-up-item-grid", title: function() { return "Multi-Up Item Grid"; }, blockGroup: 'Exhibit item widgets', icon_name: "multi-up-item-grid", inputFieldsCount: 5, carouselCycleTimesInSeconds: { values: [ 3, 5, 8, 12, 20 ], selected: 5 }, carouselMaxHeights: { values: { 'Small': 200, 'Medium': 350, 'Large': 500 }, selected: 'Medium' }, onBlockRender: function() { Spotlight.Block.prototype.onBlockRender.apply(); this.loadCaptionField(); this.addCaptionSelectFocus(); this.makeItemGridNestable(); }, afterLoadData: function(data){ // set a data attribute on the select fields so the ajax request knows which option to select this.$('select#' + this.formId(this.primary_field_key)).data('select-after-ajax', data[this.primary_field_key]); this.$('select#' + this.formId(this.secondary_field_key)).data('select-after-ajax', data[this.secondary_field_key]); var context = this; context.$('[data-target-panel]').each(function(i){ if ($(this).prop("value") != "") { var target_panel = $(this), object_id = data[context.id_key + "_" + i], object_title = data[context.id_key + "_" + i + "_title"], object_thumbnail = data[context.thumbnail_key + "_" + i]; $.ajax($('form[data-autocomplete-url]').data('autocomplete-url') + '?q=id:' + object_id).success(function(ajaxData){ var thumbnails = ajaxData['docs'][0]['thumbnails'], privateLabel = ajaxData['docs'][0]['private']; swapInputForPanel(target_panel, context.$(target_panel.data('target-panel')), { id: object_id, title: object_title, thumbnail: object_thumbnail, thumbnails: thumbnails, private: privateLabel }); }); } }); }, description: "This widget displays one to five thumbnail images of repository items in a single row grid. Optionally, you can a caption below each image..", template: [ '