diff --git a/resources/js/HelioviewerClient.js b/resources/js/HelioviewerClient.js index 63e35e27b..5285a09c1 100644 --- a/resources/js/HelioviewerClient.js +++ b/resources/js/HelioviewerClient.js @@ -42,9 +42,16 @@ var HelioviewerClient = Class.extend( * @description Checks browser support for various features used in Helioviewer */ _checkBrowser: function () { + let localStorageSupport = true; + try { + localStorageSupport = ('localStorage' in window) && window['localStorage'] !== null; + } catch (e) { + localStorageSupport = false; + } + // Base support $.extend($.support, { - "localStorage" : ('localStorage' in window) && window['localStorage'] !== null, + "localStorage" : localStorageSupport, "nativeJSON" : typeof (JSON) !== "undefined", "video" : !!document.createElement('video').canPlayType, "h264" : false, diff --git a/resources/js/UI/ImageScale.js b/resources/js/UI/ImageScale.js index c61fd32e8..8e3e93dd3 100644 --- a/resources/js/UI/ImageScale.js +++ b/resources/js/UI/ImageScale.js @@ -236,13 +236,24 @@ var ImageScale = Class.extend( Helioviewer.userSettings.get("state.containerY") <= ( $('#hv-header').height() || 0 ) || Helioviewer.userSettings.get("state.containerY") >= this.container.parent().height()-this.container.height() ) { - this.containerX = this.container.parent().width()*0.66 - this.container.width()/2; //center the earth container - this.containerY = $('#earth-button').position().top + $('#scale').position().top + this.container.height(); - this.container.css({ - 'position' : 'absolute', - 'top' : this.containerY+'px', - 'left' : this.containerX+'px' - }); + if (outputType == 'embed') { + this.containerX = 15; + this.containerY = this.container.parent().height() - this.container.height() - 15; + this.container.css({ + 'position' : 'absolute', + 'top' : this.containerY+'px', + 'left' : this.containerX+'px' + }); + } else { + this.containerX = this.container.parent().width()*0.66 - this.container.width()/2; //center the earth container + this.containerY = $('#earth-button').position().top + $('#scale').position().top + this.container.height(); + this.container.css({ + 'position' : 'absolute', + 'top' : this.containerY+'px', + 'left' : this.containerX+'px' + }); + } + } }else{// minimal helioviewer var dm = $('#date-manager-container'); @@ -319,12 +330,16 @@ var ImageScale = Class.extend( switch(outputType) { case "minimal": - case "embed": var sc = $('#scale'); this.containerX = sc.position().left + (sc.outerWidth()/2) - this.container.width()/2; //center the earth container this.containerY = sc.position().top - this.container.height() - 3; this.scale = true; break; + case "embed": + this.scale = false; + this.containerX = 15; + this.containerY = this.container.parent().height() - this.container.height() - 15; + break; default: this.containerX = this.container.parent().width()*0.66 - this.container.width()/2; //center the earth container this.containerY = $('#earth-button').position().top + $('#scale').position().top + this.container.height();