Skip to content

Commit

Permalink
Increase museum z-index and use localstorage for disabling museum
Browse files Browse the repository at this point in the history
  • Loading branch information
Trufi committed Jun 14, 2018
1 parent 1a2de61 commit a96c919
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/DGMuseum/skin/basic/less/dg-museum.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
top: 0;
left: 0;
right: 0;
z-index: 500;
z-index: 1500;
padding: 4px 5px 8px;
background: #333;
color: #fff;
Expand Down
19 changes: 18 additions & 1 deletion src/DGMuseum/src/DGMuseum.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,17 @@ var ie9 = (function() {
return Boolean(all[0]);
})();

var wasPreviouslyDisabled = false;

// Old Safari throws error when localStorage.getItem calls in private mode
try {
wasPreviouslyDisabled = localStorage.getItem('DGMuseum') === 'false';
} catch (err) {
// do nothing
}

DG.Map.mergeOptions({
museum: DG.Browser.ielt9 || ie9 || DG.Browser.opera12 || DG.Browser.safari51
museum: !wasPreviouslyDisabled && (DG.Browser.ielt9 || ie9 || DG.Browser.opera12 || DG.Browser.safari51)
});

DG.Map.Museum = DG.Handler.extend({
Expand Down Expand Up @@ -70,6 +79,14 @@ DG.Map.Museum = DG.Handler.extend({

_onCloseButtonClick: function(e) {
DG.DomEvent.stop(e);

// Old Safari throws error when localStorage.getItem calls in private mode
try {
localStorage.setItem('DGMuseum', 'false');
} catch (err) {
// do nothing
}

this.disable();
},

Expand Down

0 comments on commit a96c919

Please sign in to comment.