diff --git a/dashboard-ui/scripts/registrationservices.js b/dashboard-ui/scripts/registrationservices.js index 21808c38d7..0b61135b65 100644 --- a/dashboard-ui/scripts/registrationservices.js +++ b/dashboard-ui/scripts/registrationservices.js @@ -1,6 +1,6 @@ (function () { - var supporterPlaybackKey = 'lastSupporterPlaybackMessage2'; + var supporterPlaybackKey = 'lastSupporterPlaybackMessage4'; function validatePlayback(deferred) { @@ -97,42 +97,52 @@ function showPlaybackOverlay(deferred) { - require(['paperbuttonstyle']); + require(['components/paperdialoghelper'], function () { - var html = ''; - html += '
'; - html += '
'; - html += '
'; + var dlg = PaperDialogHelper.createDialog({}); - html += '

' + Globalize.translate('HeaderTryEmbyPremiere') + '

'; + var html = ''; + html += '

'; + html += ''; + html += '

'; - html += '

' + Globalize.translate('MessageDidYouKnowCinemaMode') + '

'; - html += '

' + Globalize.translate('MessageDidYouKnowCinemaMode2') + '

'; + html += '
'; - html += '
'; + html += '

' + Globalize.translate('HeaderTryEmbyPremiere') + '

'; - html += '

' + Globalize.translate('HeaderBenefitsEmbyPremiere') + '

'; + html += '

' + Globalize.translate('MessageDidYouKnowCinemaMode') + '

'; + html += '

' + Globalize.translate('MessageDidYouKnowCinemaMode2') + '

'; - html += '
'; - html += getSubscriptionBenefits().map(getSubscriptionBenefitHtml).join(''); - html += '
'; + html += '
'; - html += '
'; + html += '

' + Globalize.translate('HeaderBenefitsEmbyPremiere') + '

'; - html += '' + Globalize.translate('ButtonBecomeSupporter') + ''; - html += '' + Globalize.translate('ButtonClosePlayVideo') + ''; + html += '
'; + html += getSubscriptionBenefits().map(getSubscriptionBenefitHtml).join(''); + html += '
'; - html += '
'; - html += '
'; - html += '
'; + html += '
'; - $(document.body).append(html); + html += '' + Globalize.translate('ButtonBecomeSupporter') + ''; + html += '' + Globalize.translate('ButtonClosePlayVideo') + ''; - $('.btnCancelSupporterInfo').on('click', function () { + html += '
'; - $('.supporterInfoOverlay').remove(); - appStorage.setItem(supporterPlaybackKey, new Date().getTime()); - deferred.resolve(); + dlg.innerHTML = html; + document.body.appendChild(dlg); + + // Has to be assigned a z-index after the call to .open() + dlg.addEventListener('iron-overlay-closed', function(e) { + appStorage.setItem(supporterPlaybackKey, new Date().getTime()); + dlg.parentNode.removeChild(dlg); + deferred.resolve(); + }); + + PaperDialogHelper.openWithHash(dlg, 'premiere'); + + $('.btnCancelSupporterInfo').on('click', function () { + PaperDialogHelper.close(dlg); + }); }); }