|
1 | 1 | // ==UserScript==
|
2 | 2 | // @name UnityForumFixer
|
3 | 3 | // @namespace https://unitycoder.com/
|
4 |
| -// @version 0.84 (27.04.2025) |
| 4 | +// @version 0.85 (27.04.2025) |
5 | 5 | // @description Fixes For Unity Forums - https://github.com/unitycoder/UnityForumFixer
|
6 | 6 | // @author unitycoder.com
|
7 | 7 | // @match https://discussions.unity.com/latest
|
@@ -164,8 +164,15 @@ function AppendCustomCSS()
|
164 | 164 |
|
165 | 165 | code.lang-auto, code.language-csharp { font-family: 'Fira Code', monospace; }
|
166 | 166 | .select-kit .select-kit-row {padding: 0px 0px 0px 6px !important;} /* project area dropdown */
|
167 |
| -
|
| 167 | + /* notification dismiss button */ |
168 | 168 |
|
| 169 | + .quick-access-panel .panel-body-bottom {position:absolute;top:0;left:0;right:0;margin:8px 0;display:flex;justify-content:flex-end;padding:0 8px;background:transparent;border:none;box-shadow:none;} |
| 170 | + .quick-access-panel .btn.no-text.btn-default.show-all { height:20px; } |
| 171 | + .quick-access-panel .notifications-dismiss {font-size:0.8em;padding:4px 8px;height:20px; min-width:50%;} |
| 172 | + .panel-body-contents {margin-top:30px !important;} |
| 173 | +
|
| 174 | + img.avatar[title] { pointer-events: none; } |
| 175 | +
|
169 | 176 | `;
|
170 | 177 | document.head.appendChild(style);
|
171 | 178 | }
|
@@ -660,24 +667,33 @@ function replaceNotificationIcons() {
|
660 | 667 |
|
661 | 668 | function AddOnHoverOpenNotificationPanel() {
|
662 | 669 | const currentUserButton = document.getElementById('toggle-current-user');
|
| 670 | + const headerArea = document.getElementById('main-outlet'); |
| 671 | + const dropdown = document.querySelector('.user-menu.revamped.menu-panel.drop-down'); |
663 | 672 |
|
664 |
| - if (currentUserButton) { |
665 |
| - // Add mouseover event to trigger the button's click |
| 673 | + if (currentUserButton && headerArea) { |
| 674 | + // Open the panel on hover over the user button |
666 | 675 | currentUserButton.addEventListener('mouseenter', () => {
|
667 |
| - // Check if the dropdown is already open |
668 |
| - const dropdown = document.querySelector('.user-menu.revamped.menu-panel.drop-down'); |
669 |
| - if (dropdown==null) { |
670 |
| - currentUserButton.click(); // Simulate a click to open the dropdown |
| 676 | + if (!dropdown) { |
| 677 | + currentUserButton.click(); |
| 678 | + } |
| 679 | + }); |
| 680 | + |
| 681 | + // Close the panel when mouse moves over the header area |
| 682 | + headerArea.addEventListener('mouseenter', () => { |
| 683 | + if (dropdown) { |
| 684 | + currentUserButton.click(); // Simulate click outside to close |
671 | 685 | }
|
672 | 686 | });
|
| 687 | + |
673 | 688 | } else {
|
674 |
| - console.warn('Current user button not found.'); |
| 689 | + console.warn('Current user button or header area not found.'); |
675 | 690 | }
|
676 | 691 | }
|
677 | 692 |
|
678 | 693 |
|
679 | 694 |
|
680 | 695 |
|
| 696 | + |
681 | 697 | // HELPER METHODS
|
682 | 698 |
|
683 | 699 | function formatDate(date)
|
|
0 commit comments