Fix pressing enter triggers trophy badge handler
authorJoshua Rüsweg <josh@bastelstu.be>
Thu, 31 Jan 2019 15:53:03 +0000 (16:53 +0100)
committerJoshua Rüsweg <josh@bastelstu.be>
Thu, 31 Jan 2019 15:53:03 +0000 (16:53 +0100)
Fixes #2818

wcfsetup/install/files/acp/templates/trophyAdd.tpl
wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Trophy/Badge.js

index 69fa97524873db2283d9a366f4d2736c4c9c4d0e..64c785a7ef8c9a3037f7092c71c9f5045fe8bef9 100644 (file)
                                <dt>{lang}wcf.acp.trophy.type.badge{/lang}</dt>
                                <dd>
                                        <span class="icon icon64 fa-{$iconName} jsTrophyIcon trophyIcon" style="color: {$iconColor}; background-color: {$badgeColor}"></span>
-                                       <button class="small">{lang}wcf.global.button.edit{/lang}</button>
+                                       <span class="button small">{lang}wcf.global.button.edit{/lang}</span>
                                        
                                        <input type="hidden" name="iconName" value="{$iconName}">
                                        <input type="hidden" name="iconColor" value="{$iconColor}">
index d0fbb6228d40bd74b205136e7adf254704326e2d..e49bac88de692d7784a0b9491b628546003f1935 100644 (file)
@@ -20,7 +20,7 @@ define(['Core', 'Dictionary', 'Language', 'Ui/Dialog', 'WoltLabSuite/Core/Ui/Col
                 */
                init: function () {
                        var iconContainer = elById('badgeContainer');
-                       elBySel('button', iconContainer).addEventListener(WCF_CLICK_EVENT, this._click.bind(this));
+                       elBySel('.button', iconContainer).addEventListener(WCF_CLICK_EVENT, this._click.bind(this));
                        
                        _iconNameInput = elBySel('input[name="iconName"]', iconContainer);
                        _iconColorInput = elBySel('input[name="iconColor"]', iconContainer);