-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix alerts bug when using non-full-width position #19
Changes from 1 commit
f5a6de7
337f25b
11d6f06
a669c34
71e34a3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -301,21 +301,22 @@ Module.register("MMM-MBTA", { | |
wrapper.appendChild(alertTable); | ||
} else if (uniqueAlerts.size > 0) { | ||
var alertHeader = document.createElement("header"); | ||
alertHeader.className = "module-header alerts"; | ||
alertHeader.className = "module-header alerts-header"; | ||
alertHeader.innerHTML = "Alerts"; | ||
wrapper.appendChild(alertHeader); | ||
|
||
var alertTable = document.createElement("table"); | ||
alertTable.className = "small"; | ||
var alertTable = document.createElement("div"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are tables common with MagicMirror modules? Got rid of it as it can cause annoying css behavior. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure. It's been so long since I've written this. I'll just take your word for it, and it was probably the primary reason it's been so buggy as well? |
||
alertTable.className = "alerts small"; | ||
|
||
for (let alert of uniqueAlerts) { | ||
var alertText = alert; | ||
|
||
var row = document.createElement("tr"); | ||
var row = document.createElement("div"); | ||
row.className = "alert-wrapper"; | ||
alertTable.appendChild(row); | ||
alertTable.style.cssText = "width: inherit"; | ||
// alertTable.style.cssText = "width: inherit"; | ||
|
||
var alertCell = document.createElement("td"); | ||
var alertCell = document.createElement("div"); | ||
alertCell.innerHTML = alertText; | ||
alertCell.className = "light small alert"; | ||
row.appendChild(alertCell); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
300px
felt like a good max-width