Skip to content

Commit 5bb2d95

Browse files
committed
key image mp4 not properly trapped for existance
1 parent 1bd66c5 commit 5bb2d95

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

system/application/views/melons/cantaloupe/js/scalarpage.jquery.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2510,7 +2510,11 @@
25102510
}
25112511

25122512
var banner = currentNode.banner;
2513-
if ('undefined' != typeof(banner) && banner.length && -1 == banner.indexOf('//')) banner = $('link#parent').attr('href') + banner;
2513+
if ('undefined' != typeof(banner) && banner.length && -1 == banner.indexOf('//')) {
2514+
banner = $('link#parent').attr('href') + banner;
2515+
} else if ('undefined' == typeof(banner) || !banner) {
2516+
banner = '';
2517+
};
25142518
$('[property="art:url"]').hide();
25152519
if ('.mp4'==banner.substr(banner.length-4, 4)) { // The controller looks for ".mp4" so do the same here ~cd
25162520
element.addClass('has_video').prepend('<div class="video_wrapper"><video autoplay muted loop playsinline preload="none"><source src="'+banner+'" type="video/mp4"></video></div>');
@@ -2603,7 +2607,11 @@
26032607

26042608
case 'image_header':
26052609
var banner = currentNode.banner;
2606-
if ('undefined' != typeof(banner) && banner.length && -1 == banner.indexOf('//')) banner = $('link#parent').attr('href') + banner;
2610+
if ('undefined' != typeof(banner) && banner.length && -1 == banner.indexOf('//')) {
2611+
banner = $('link#parent').attr('href') + banner;
2612+
} else if ('undefined' == typeof(banner) || !banner) {
2613+
banner = '';
2614+
};
26072615
$('.page').css('padding-top', '5rem');
26082616
$('article > header').before('<div class="image_header"><div class="title_card"></div></div>');
26092617
if ('.mp4'==banner.substr(banner.length-4, 4)) { // The controller looks for ".mp4" so do the same here ~cd
@@ -2928,7 +2936,11 @@
29282936
var title = pathContents[i].current.title;
29292937
var slug = pathContents[i].slug;
29302938
var key = (pathContents[i].data['http://scalar.usc.edu/2012/01/scalar-ns#banner']) ? pathContents[i].data['http://scalar.usc.edu/2012/01/scalar-ns#banner'][0].value : '';
2931-
if (-1==key.indexOf('://')) key = base_url+key;
2939+
if ('undefined'==typeof(key)) {
2940+
key = '';
2941+
} else if (-1==key.indexOf('://')) {
2942+
key = base_url+key;
2943+
}
29322944
var description = (pathContents[i].current.description) ? pathContents[i].current.description : ' ';
29332945
var $description = $('<div>'+description+'</div>');
29342946
if ($description.find('br').length) { // If there is more than one paragraph (<br /><br />) only show the first paragraph

0 commit comments

Comments
 (0)