- Affected App
- WoltLab Suite Core
Ich bin gerade dabei mein UserMenu Eintrag den ich per Event einbinde, auf das neue Dropdown aussehen anzupassen. Dabei ist mir aufgefallen das ich ein Problem mit den badge habe.
Mein Dropdown besteht aus mehrende links mit unterschiedlichen badge Werten.
Das Dropdown lässt sich nur einmalig öffnen beim zweiten mall gibt es ein Consolen fehler
Uncaught TypeError: Cannot read property 'children' of null @ https://github.com/WoltLab/WCF…files/js/WCF.User.js#L210
Mein Dropdown menu sollte schon Statisch bleiben die badge werden per Cache übergeben.
<?xml version="1.0" encoding="UTF-8"?>
<data xmlns="http://www.woltlab.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.woltlab.com http://www.woltlab.com/XSD/templatelistener.xsd">
<import>
<templatelistener name="userPanel">
<environment>user</environment>
<templatename>userPanel</templatename>
<eventname>menuItems</eventname>
<templatecode><![CDATA[{include file='__userPanelQuickDropdown' application='wcf'}]]></templatecode>
</templatelistener>
</import>
</data>
Display More
{if !OFFLINE || $__wcf->session->getPermission('admin.general.canViewPageDuringOfflineMode')}
{assign var=unsolvedQuickCount value='0'}
<li id="unreadQuick" data-count="{$unsolvedQuickCount}">
<a href="{link}{/link}"><span class="icon icon16 icon-tasks"></span> <span>{lang}wcf.cafeanime.quickMenu.head{/lang}</span> {if $unsolvedQuickCount}<span class="badge badgeInverse">{#$unsolvedQuickCount}</span>{/if}</a>
<div class="interactiveDropdown interactiveDropdownStatic interactiveDropdownUnreadQuick">
<div class="interactiveDropdownItemsContainer">
<ul class="interactiveDropdownItems interactiveDropdownItemsUnreadQuick">
<li><a href="{link application='anima' controller='AnimeList'}mod=Activate{/link}">{lang}xxx{/lang} {if $animeModeration[activate]|isset && $animeModeration[activate] > 0}<span class="badge">{#$animeModeration[activate]}</span>{/if}</a></li>{if $animeModeration[activate]|isset && $animeModeration[activate] > 0}{assign var=unsolvedQuickCount value=$unsolvedQuickCount + $animeModeration[activate]}{/if}
<li><a href="{link application='anima' controller='AnimeList'}mod=Delete{/link}">{lang}xxx{/lang} {if $animeModeration[delete]|isset && $animeModeration[delete] > 0}<span class="badge">{#$animeModeration[delete]}</span>{/if}</a></li>
</ul>
</div>
</div>
</li>
<script data-relocate="true">
WCF.User.Panel.QuickMenu = WCF.User.Panel.Abstract.extend({
init: function() {
this._super($('#unreadQuick'), 'unreadQuick', {
pointerOffset: '13px',
staticDropdown: true
});
}
});
$(function() {
new WCF.User.Panel.QuickMenu();
});
</script>
{/if}
Display More
Mein Problem ist <span class="badge"> und dies will ich an ort und stelle weiter nutzen aber Das Dropdown System denkt wohl das das jetzt kein Statisches Menü ist oder so was ähnliches
Gibt es nicht die möglichkeit die abfrage @ https://github.com/WoltLab/WCF…files/js/WCF.User.js#L189 auszuschalten?
So wirklich blick ich da nicht durch gerade.