Skip to content

Commit

Permalink
bug #29184 [WebProfilerBundle] Fix theme settings (ro0NL)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 4.2-dev branch (closes #29184).

Discussion
----------

[WebProfilerBundle] Fix theme settings

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #28932 #28935
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Commits
-------

8fbe85c [WebProfilerBundle] Fix theme settings
  • Loading branch information
nicolas-grekas committed Nov 12, 2018
2 parents fb249f0 + 8fbe85c commit 6eb5f93
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
Expand Up @@ -15,7 +15,7 @@
</head>
<body>
<script async>
document.body.classList.add(localStorage.getItem('symfony/profiler/theme'), localStorage.getItem('symfony/profiler/width'));
document.body.classList.add(localStorage.getItem('symfony/profiler/theme') || 'theme-light', localStorage.getItem('symfony/profiler/width') || 'width-normal');
</script>

{% block body '' %}
Expand Down
@@ -1,6 +1,6 @@
<style>
#open-settings {
color: var(--text-muted);
color: var(--color-muted);
display: block;
margin: 15px 15px 5px;
}
Expand Down Expand Up @@ -84,6 +84,24 @@
.modal-content .form-help + h4 {
margin-top: 45px;
}
@media (max-width: 768px) {
#open-settings {
color: transparent;
}
#sidebar:hover #open-settings, #sidebar.expanded #open-settings {
color: var(--color-muted);
}
#open-settings:before {
content: '\2699';
font-weight: bold;
font-size: 25px;
color: var(--color-muted);
}
#sidebar:hover #open-settings:before, #sidebar.expanded #open-settings:before {
content: '';
}
}
</style>

<a href="#" id="open-settings" data-triger="profiler-settings">Settings</a>
Expand Down Expand Up @@ -141,8 +159,8 @@
let modalWrapper = document.getElementsByClassName('modal-wrap')[0]
openModalButton.addEventListener('click', function(event) {
document.getElementById('settings-' + localStorage.getItem('symfony/profiler/theme')).checked = 'checked';
document.getElementById('settings-' + localStorage.getItem('symfony/profiler/width')).checked = 'checked';
document.getElementById('settings-' + (localStorage.getItem('symfony/profiler/theme') || 'theme-light')).checked = 'checked';
document.getElementById('settings-' + (localStorage.getItem('symfony/profiler/width') || 'width-normal')).checked = 'checked';
modalWindow.classList.toggle('visible');
event.preventDefault();
Expand Down

0 comments on commit 6eb5f93

Please sign in to comment.