diff --git a/share/spice/octopart/octopart.css b/share/spice/octopart/octopart.css index 580701d32d..3106b40555 100644 --- a/share/spice/octopart/octopart.css +++ b/share/spice/octopart/octopart.css @@ -3,8 +3,6 @@ background-color: #e5e5e5; } -.is-mobile .detail--octopart .detail__body__content{ - position: absolute; - margin-right: 1.6em; - bottom: 4em; -} \ No newline at end of file +.is-mobile .detail--octopart .detail__body.detail__body--pr { + padding-top: 1em; +} diff --git a/share/spice/octopart/octopart.js b/share/spice/octopart/octopart.js index d8d0fdc36b..c5eb0a2bc9 100644 --- a/share/spice/octopart/octopart.js +++ b/share/spice/octopart/octopart.js @@ -36,12 +36,14 @@ function ddg_spice_octopart (api_result) { // return; // } + var isMobile = $('.is-mobile').length; + Spice.add({ id: 'octopart', name: 'Parts', data: api_result.results, signal: 'high', - + meta: { itemType: 'Parts', sourceName: 'Octopart', @@ -49,17 +51,20 @@ function ddg_spice_octopart (api_result) { }, normalize: function(item) { var img = DDG.getProperty(item, "item.images.0.url_90px"); + var desc_length = 60; + var description = (isMobile ? + Handlebars.helpers.ellipsis(DDG.strip_html(item.item.short_description), desc_length) : + DDG.strip_html(item.item.short_description)); return { brand: item.item.manufacturer.displayname, price: item.item.avg_price[1] + ' ' + item.item.avg_price[0].toFixed(2), img: img, img_m: img, - // url_review: item.item.detail_url, url: item.item.detail_url, title: DDG.strip_html(item.item.mpn).toUpperCase(), heading: DDG.strip_html(item.item.mpn).toUpperCase(), - description: DDG.strip_html(item.item.short_description), + description: description, datasheet: item.item.datasheets[0].url }; },