Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improves backwards compatibility for safari #1908

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Updated
- Remove documentation from core repository and link to new dedicated docs site: [docs.magicmirror.builders](https://docs.magicmirror.builders).
- Improves backwards compatibility for Safari < 11 (ISSUE #1897)
- Updated config.js.sample: Corrected some grammar on `config.js.sample` comment section.
- Removed `run-start.sh` script and update start commands:
- To start using electron, use `npm run start`.
Expand Down
4 changes: 4 additions & 0 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ body {
* Default styles.
*/

.hidden {
display: none;
}

.dimmed {
color: #666;
}
Expand Down
11 changes: 9 additions & 2 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ var MM = (function() {
dom.appendChild(moduleHeader);

if (typeof module.getHeader() === "undefined" || module.getHeader() !== "") {
moduleHeader.style = "display: none;";
//not using element.style for backwards compatibility (Safari < 11)
moduleHeader.classList.add("hidden");
}

var moduleContent = document.createElement("div");
Expand Down Expand Up @@ -213,7 +214,13 @@ var MM = (function() {
contentWrapper[0].appendChild(newContent);

headerWrapper[0].innerHTML = newHeader;
headerWrapper[0].style = headerWrapper.length > 0 && newHeader ? undefined : "display: none;";

//not using element.style for backwards compatibility (Safari < 11)
if (headerWrapper.length > 0 && newHeader) {
headerWrapper[0].classList.remove("hidden");
} else {
headerWrapper[0].classList.add("hidden");
}
};

/* hideModule(module, speed, callback)
Expand Down