-
Notifications
You must be signed in to change notification settings - Fork 127
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 issue] Closes #309 - moved the undo banner below reset button #312
base: master
Are you sure you want to change the base?
Conversation
Hi @rugk, thanks for your help, I was able to successfully link this PR with the issue, thanks again. Please review the code and let me know if this good to be merged or not. |
Great, note you do not need to create a new PR when you make changes, just edit your previous PR or push into the same branch and it will end up in your PR. For furture reference, this is the old PR: #311 Linking can also be done manually at the right site AFAIK even for contributors. |
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.
So while that solves the problem, we have a one big technical problem with this solution…
@@ -195,6 +189,13 @@ <h1 data-i18n="__MSG_titleAddonBehavior__">Addon behavior</h1> | |||
<hr /><br /> | |||
<button data-i18n="__MSG_optionsResetButton__" type="button" id="resetButton">Reset all settings to defaults</button> | |||
</div> | |||
<div id="messageSuccess" aria-label="success message" data-i18n data-i18n-aria-label="__MSG_ariaMessageSuccess__" class="message-box success invisible fade-hide success-undo-message-box"> |
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.
Hmm, good idea in theory, but moving all success messages there is likely not a good idea.
The thing is, you actually do not want to show all success messages here, because other modules could show other success messages and they should not be at the bottom. And if you just move the HTML element with id #messageSuccess
that is just the the default container for success messages, but good news: the MessageHandler
module can have more such arbitrary message locations/HTML elements.
That is why I've opened TinyWebEx/AutomaticSettings#28 and one would likely have to adjust that as well and then use the library here. (You can do so, it is a git submodule, online guides should tell you how to work with them…) See there for more details.
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.
So basically, I have to place the HTML I changed to the previous location, create a new id which displays the undo message, and then place a new HTML that only displays the undo message at the bottom. Did I get it right?
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.
Yeah that's it! The more or less tricky part is the fact that likely the AutomaticSettings library (module) needs to be adjusted to work with that message box instead of the success one - of course keep in mind it should at best have no breaking changes for other add-ons using the library, so that should be optional.
https://github.com/TinyWebEx/PermissionRequest does something similar/is used in the same way, as it also can register for arbitrary message boxes.
Fixed issue which Closes #309