File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -44,20 +44,24 @@ function Util:OnInitialize()
4444 StaticPopupDialogs [' TalentTreeTweaksCopyTextDialog' ] = {
4545 text = L [' CTRL-C to copy %s' ],
4646 button1 = CLOSE ,
47+ --- @param dialog StaticPopupTemplate
48+ --- @param data string
4749 OnShow = function (dialog , data )
4850 local function HidePopup ()
4951 dialog :Hide ();
5052 end
51- dialog .editBox :SetScript (' OnEscapePressed' , HidePopup );
52- dialog .editBox :SetScript (' OnEnterPressed' , HidePopup );
53- dialog .editBox :SetScript (' OnKeyUp' , function (_ , key )
53+ --- @type StaticPopupTemplate_EditBox
54+ local editBox = dialog .GetEditBox and dialog :GetEditBox () or dialog .editBox ;
55+ editBox :SetScript (' OnEscapePressed' , HidePopup );
56+ editBox :SetScript (' OnEnterPressed' , HidePopup );
57+ editBox :SetScript (' OnKeyUp' , function (_ , key )
5458 if IsControlKeyDown () and (key == ' C' or key == ' X' ) then
5559 HidePopup ();
5660 end
5761 end );
58- dialog . editBox :SetMaxLetters (0 );
59- dialog . editBox :SetText (data );
60- dialog . editBox :HighlightText ();
62+ editBox :SetMaxLetters (0 );
63+ editBox :SetText (data );
64+ editBox :HighlightText ();
6165 end ,
6266 hasEditBox = true ,
6367 editBoxWidth = 240 ,
You can’t perform that action at this time.
0 commit comments