-
Notifications
You must be signed in to change notification settings - Fork 384
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
CLDR-16844 Show the Dashboard by default, and remember user preference #3934
Changes from 3 commits
1d29d6c
a9d34c1
832d698
924e68d
98d59be
72bfb70
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 |
---|---|---|
|
@@ -29,6 +29,7 @@ export default { | |
specialGeneral: null, | ||
}; | ||
}, | ||
|
||
mounted() { | ||
const locmap = cldrLoad.getTheLocaleMap(); | ||
const bund = locmap.getLocaleInfo(cldrStatus.getCurrentLocale()); | ||
|
@@ -52,8 +53,23 @@ export default { | |
} | ||
|
||
this.specialGeneral = cldrText.get("generalSpecialGuidance"); | ||
|
||
this.showDashboardOrButton(); | ||
}, | ||
|
||
methods: { | ||
showDashboardOrButton() { | ||
// If Dashboard is already visible, hide the button for opening it. | ||
if (cldrDashContext.isVisible()) { | ||
const els = document.getElementsByClassName("general-open-dash"); | ||
for (let i = 0; i < els.length; i++) { | ||
els[i].style.display = "none"; | ||
} | ||
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. why this and not a reactive vue property? 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. It was based on similar code in cldrDashContext.mjs. I can change it to a property... 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. Changed to a property |
||
} else if (cldrDashContext.shouldBeShown()) { | ||
this.insertDashboard(); | ||
} | ||
}, | ||
|
||
insertDashboard() { | ||
cldrDashContext.insert(); | ||
}, | ||
|
@@ -66,4 +82,10 @@ button.general-open-dash { | |
/* We only want THIS button to float, not all Open Dashboard buttons. */ | ||
float: right; | ||
} | ||
|
||
p.special_general { | ||
margin: 1em; | ||
padding: 1em; | ||
border: 2px solid gray; | ||
} | ||
</style> |
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.
we could integrate this better, but this is sufficient for now.
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.
Really all of these keys could benefit from encapsulation. I'm not sure what how/where, though... using
cldrLoad.GENERAL_SPECIAL
in place ofgeneral
for the key isn't allowed in the initializer, but we could have initialization code likeand likewise for the other keys...