mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 00:20:25 +08:00 
			
		
		
		
	Improve PR Review Box UI (#22986)
This PR follows: * #22950 ### Before The Review Box has many problems: * It doesn't work for small screens. * It has an anonying animation which makes the UI laggy. * It uses "custom dropdown menu" which is very difficult to fine tune. * `$().toggle('visible')` is not a correct call * jQuery just accepts any invalid `duration` argument: `$().toggle('anyting')` * The button is not a button. <details>  </details> ### After These problems are fixed, and eliminate many `!important` games. <details>    </details> And most dropdown icons still looks good: <details>   </details> Co-authored-by: delvh <leon@kske.dev>
This commit is contained in:
		@@ -60,6 +60,7 @@ export function initGlobalEnterQuickSubmit() {
 | 
			
		||||
export function initGlobalButtonClickOnEnter() {
 | 
			
		||||
  $(document).on('keypress', '.ui.button', (e) => {
 | 
			
		||||
    if (e.keyCode === 13 || e.keyCode === 32) { // enter key or space bar
 | 
			
		||||
      if (e.target.nodeName === 'BUTTON') return; // button already handles space&enter correctly
 | 
			
		||||
      $(e.target).trigger('click');
 | 
			
		||||
      e.preventDefault();
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user