{"version":3,"sources":["feeds/digital-collections.min.js"],"names":["$","scrolledAubreyFeeds","document","querySelector","scrolledAubreyFeedsObserver","IntersectionObserver","entries","forEach","entry","intersectionRatio","console","log","unobserve","target","when","get","done","dataDigital","dataPTH","$cardHeader","$listGroup","entriesDigital","find","toArray","entriesPTH","concat","limitedData","_","sampleSize","each","$this","this","href","attr","title","text","$title","class","append","observe"],"mappings":"AAAA,aACAA,GAAE,WAGE,IAAIC,EAAsBC,SAASC,cAAc,wBAC7CC,EAA8B,IAAIC,sBAAqB,SAAAC,GACrDA,EAAQC,SAAQ,SAAAC,GACVA,EAAMC,kBAAoB,IAE5BC,QAAQC,IAAI,eACZP,EAA4BQ,UAAWJ,EAAMK,QAE7Cb,EAAEc,KAAKd,EAAEe,IAAI,6DACXf,EAAEe,IAAI,2DACLC,MAAK,SAACC,EAAaC,GAClB,IAAMC,EAAcnB,EAAE,oEAChBoB,EAAapB,EAAE,mDACfqB,EAAiBrB,EAAEiB,EAAY,IAAIK,KAAK,SAASC,UACjDC,EAAaxB,EAAEkB,EAAQ,IAAII,KAAK,SAASC,UACzCjB,EAAUe,EAAeI,OAAOD,GAChCE,EAAcC,EAAEC,WAAWtB,EAAS,GAE1CN,EAAE0B,GAAaG,MAAK,WAClB,IAAMC,EAAQ9B,EAAE+B,MACVC,EAAOF,EAAMR,KAAK,QAAQW,KAAK,QAC/BC,EAAQJ,EAAMR,KAAK,SAASa,OAC5BC,EAASpC,EAAE,WACdiC,KAAK,CAAED,KAAAA,EAAMK,MAAO,oBACpBC,OAAOJ,GAEVd,EAAWkB,OAAOF,MAEpBpC,EAAE,2CAA2CsC,OAAOnB,EAAaC,aAM/EhB,EAA4BmC,QAAStC","file":"digital-collections.min.js","sourcesContent":["/* eslint-disable no-undef */\n$(() => {\n\n // Set scrolling header ui by observing main nav relative to viewport\n let scrolledAubreyFeeds = document.querySelector(\"#digital-collections\"),\n scrolledAubreyFeedsObserver = new IntersectionObserver(entries => {\n entries.forEach(entry => {\n if (entry.intersectionRatio > 0) {\n\n console.log('in the view');\n scrolledAubreyFeedsObserver.unobserve( entry.target );\n\n $.when($.get('https://digital.library.unt.edu/explore/collections/feed/'),\n $.get('https://texashistory.unt.edu/explore/collections/feed/'))\n .done((dataDigital, dataPTH) => {\n const $cardHeader = $('
New Digital Collections
');\n const $listGroup = $('
');\n const entriesDigital = $(dataDigital[0]).find('entry').toArray();\n const entriesPTH = $(dataPTH[0]).find('entry').toArray();\n const entries = entriesDigital.concat(entriesPTH);\n const limitedData = _.sampleSize(entries, 4);\n\n $(limitedData).each(function () {\n const $this = $(this);\n const href = $this.find('link').attr('href');\n const title = $this.find('title').text();\n const $title = $('')\n .attr({ href, class: 'list-group-item' })\n .append(title);\n\n $listGroup.append($title);\n });\n $('#digital-collections-recent-collections').append($cardHeader, $listGroup);\n });\n }\n });\n });\n // do the observing\n scrolledAubreyFeedsObserver.observe( scrolledAubreyFeeds );\n\n});"]}