diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2019-11-18 11:56:28 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-18 11:56:28 +0300 |
commit | 65415140ebf9b9a0d0b7d34d922cee60c6e2f886 (patch) | |
tree | 75faf9eee32d01b65ffd96f87fcc220afc30df50 /plugins/Overlay | |
parent | 21b49c1358cccc2ca92133be17021083d75f98ee (diff) |
Disable range select until overlay is fully loaded. (#15162)
* Disable range select until overlay is fully loaded.
* If iframe origin cannot be parsed, do not throw.
Diffstat (limited to 'plugins/Overlay')
-rw-r--r-- | plugins/Overlay/javascripts/Piwik_Overlay.js | 4 | ||||
-rw-r--r-- | plugins/Overlay/templates/index.twig | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/plugins/Overlay/javascripts/Piwik_Overlay.js b/plugins/Overlay/javascripts/Piwik_Overlay.js index 897bbbd394..05211a05ef 100644 --- a/plugins/Overlay/javascripts/Piwik_Overlay.js +++ b/plugins/Overlay/javascripts/Piwik_Overlay.js @@ -122,6 +122,7 @@ var Piwik_Overlay = (function () { /** Hide the loading message */ function hideLoading() { $loading.hide(); + $('#overlayDateRangeSelect').prop('disabled', false).material_select(); } function getOverlaySegment(url) { @@ -145,7 +146,8 @@ var Piwik_Overlay = (function () { } function setIframeOrigin(location) { - iframeOrigin = location.match(ORIGIN_PARSE_REGEX)[0]; + var m = location.match(ORIGIN_PARSE_REGEX); + iframeOrigin = m ? m[0] : null; // unset iframe origin if it is not one of the site URLs var validSiteOrigins = Piwik_Overlay.siteUrls.map(function (url) { diff --git a/plugins/Overlay/templates/index.twig b/plugins/Overlay/templates/index.twig index 5001bc8484..c98d310787 100644 --- a/plugins/Overlay/templates/index.twig +++ b/plugins/Overlay/templates/index.twig @@ -16,7 +16,7 @@ <div id="overlayDateRangeSelection"> <span class="icon icon-calendar"></span> - <select id="overlayDateRangeSelect" name="overlayDateRangeSelect"> + <select id="overlayDateRangeSelect" name="overlayDateRangeSelect" disabled> <option value="day;today">{{ 'Intl_Today'|translate }}</option> <option value="day;yesterday">{{ 'Intl_Yesterday'|translate }}</option> <option value="week;today">{{ 'General_CurrentWeek'|translate }}</option> |