diff --git a/dashboard-ui/components/tvguide/tvguide.js b/dashboard-ui/components/tvguide/tvguide.js index 2bdcaeecbe..766cf19644 100644 --- a/dashboard-ui/components/tvguide/tvguide.js +++ b/dashboard-ui/components/tvguide/tvguide.js @@ -289,10 +289,6 @@ programGrid.innerHTML = html.join(''); $(programGrid).scrollTop(0).scrollLeft(0); - - if (options.enableHoverMenu) { - $(programGrid).createGuideHoverMenu('.programCell'); - } } function renderChannelHeaders(page, channels) { diff --git a/dashboard-ui/scripts/livetvchannel.js b/dashboard-ui/scripts/livetvchannel.js index 143b94ad3c..e725b202cd 100644 --- a/dashboard-ui/scripts/livetvchannel.js +++ b/dashboard-ui/scripts/livetvchannel.js @@ -95,8 +95,6 @@ html += ''; } - - $('#childrenContent', page).html(html).createGuideHoverMenu('.tvProgramInfo'); } function loadPrograms(page, channelId) { diff --git a/dashboard-ui/scripts/livetvcomponents.js b/dashboard-ui/scripts/livetvcomponents.js index e046aa9072..a0e81b1e4a 100644 --- a/dashboard-ui/scripts/livetvcomponents.js +++ b/dashboard-ui/scripts/livetvcomponents.js @@ -145,264 +145,4 @@ getTimersHtml: getTimersHtml }; -}); - -define(['jQuery'], function ($) { - - var showOverlayTimeout; - var hideOverlayTimeout; - var currentPosterItem; - - function onOverlayMouseOver() { - - if (hideOverlayTimeout) { - clearTimeout(hideOverlayTimeout); - hideOverlayTimeout = null; - } - } - - function onOverlayMouseOut() { - - startHideOverlayTimer(); - } - - function getOverlayHtml(item) { - - var html = ''; - - html += '
'; - - if (item.EpisodeTitle) { - html += '

'; - html += item.EpisodeTitle; - html += '

'; - } - - html += '

'; - - html += '

'; - html += ''; - html += LibraryBrowser.getRatingHtml(item); - html += ''; - html += ''; - html += LibraryBrowser.getUserDataIconsHtml(item); - html += ''; - html += '

'; - - html += '

'; - - html += '

'; - html += (item.Overview || ''); - html += '

'; - - html += '
'; - - var endDate; - var startDate; - var now = new Date().getTime(); - - try { - - endDate = parseISO8601Date(item.EndDate, { toLocal: true }); - - } catch (err) { - endDate = now; - } - - try { - - startDate = parseISO8601Date(item.StartDate, { toLocal: true }); - - } catch (err) { - startDate = now; - } - - - if (now < endDate && now >= startDate) { - html += '' + Globalize.translate('ButtonPlay') + ''; - } - - if (!item.TimerId && !item.SeriesTimerId) { - html += '' + Globalize.translate('ButtonRecord') + ''; - } - - html += '
'; - - html += '
'; - - return html; - } - - function onPlayClick() { - - hideOverlay(); - - MediaController.play({ - ids: [this.getAttribute('data-id')] - }); - } - - function onRecordClick() { - hideOverlay(); - - var programId = this.getAttribute('data-id'); - require(['components/recordingcreator/recordingcreator'], function (recordingcreator) { - recordingcreator.show(programId); - }); - } - - function showOverlay(elem, item) { - - require(['paperdialoghelper', 'scale-up-animation', 'fade-out-animation'], function (paperdialoghelper) { - - var dlg = document.createElement('paper-dialog'); - - dlg.setAttribute('with-backdrop', 'with-backdrop'); - dlg.setAttribute('role', 'alertdialog'); - - // seeing max call stack size exceeded in the debugger with this - dlg.setAttribute('noAutoFocus', 'noAutoFocus'); - dlg.entryAnimation = 'scale-up-animation'; - dlg.exitAnimation = 'fade-out-animation'; - dlg.classList.add('ui-body-b'); - dlg.classList.add('background-theme-b'); - dlg.classList.add('tvProgramOverlay'); - - var html = ''; - html += '

'; - html += item.Name; - html += '

'; - - html += '
'; - html += getOverlayHtml(item); - html += '
'; - - dlg.innerHTML = html; - document.body.appendChild(dlg); - - // Has to be assigned a z-index after the call to .open() - $(dlg).on('iron-overlay-closed', function () { - - $(dlg).off('mouseenter', onOverlayMouseOver); - $(dlg).off('mouseleave', onOverlayMouseOut); - - this.parentNode.removeChild(this); - - if (currentPosterItem) { - - currentPosterItem = null; - } - }); - - $('.btnPlay', dlg).on('click', onPlayClick); - $('.btnRecord', dlg).on('click', onRecordClick); - - LibraryBrowser.renderGenres($('.itemGenres', dlg), item, 3); - $('.miscTvProgramInfo', dlg).html(LibraryBrowser.getMiscInfoHtml(item)); - - paperdialoghelper.positionTo(dlg, elem); - - dlg.open(); - - $(dlg).on('mouseenter', onOverlayMouseOver); - $(dlg).on('mouseleave', onOverlayMouseOut); - - currentPosterItem = elem; - }); - } - - function onProgramClicked() { - - if (showOverlayTimeout) { - clearTimeout(showOverlayTimeout); - showOverlayTimeout = null; - } - - if (hideOverlayTimeout) { - clearTimeout(hideOverlayTimeout); - hideOverlayTimeout = null; - } - - hideOverlay(); - } - - function hideOverlay() { - - var flyout = document.querySelector('.tvProgramOverlay'); - - if (flyout) { - flyout.close(); - } - } - - function startHideOverlayTimer() { - - if (hideOverlayTimeout) { - clearTimeout(hideOverlayTimeout); - hideOverlayTimeout = null; - } - - hideOverlayTimeout = setTimeout(hideOverlay, 200); - } - - $.fn.createGuideHoverMenu = function (childSelector) { - - function onShowTimerExpired(elem) { - - var id = elem.getAttribute('data-programid'); - - ApiClient.getLiveTvProgram(id, Dashboard.getCurrentUserId()).then(function (item) { - - showOverlay(elem, item); - - }); - } - - function onHoverOut() { - if (showOverlayTimeout) { - clearTimeout(showOverlayTimeout); - showOverlayTimeout = null; - } - } - - function onHoverIn() { - - if (showOverlayTimeout) { - clearTimeout(showOverlayTimeout); - showOverlayTimeout = null; - } - - if (hideOverlayTimeout) { - clearTimeout(hideOverlayTimeout); - hideOverlayTimeout = null; - } - - var elem = this; - - if (currentPosterItem) { - if (currentPosterItem && currentPosterItem == elem) { - return; - } else { - hideOverlay(); - } - } - - showOverlayTimeout = setTimeout(function () { - - onShowTimerExpired(elem); - - }, 1000); - } - - if (AppInfo.isTouchPreferred) { - /* browser with either Touch Events of Pointer Events - running on touch-capable device */ - return this; - } - - return this.on('mouseenter', childSelector, onHoverIn) - .on('mouseleave', childSelector, onHoverOut) - .on('click', childSelector, onProgramClicked); - }; - }); \ No newline at end of file diff --git a/dashboard-ui/scripts/livetvguide.js b/dashboard-ui/scripts/livetvguide.js index 14e414b16e..9501f4d287 100644 --- a/dashboard-ui/scripts/livetvguide.js +++ b/dashboard-ui/scripts/livetvguide.js @@ -15,8 +15,7 @@ page.guideInstance = new tvguide({ element: tabContent, - enableHeadRoom: true, - enableHoverMenu: true + enableHeadRoom: true }); }); }