mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 19:06:18 +01:00 
			
		
		
		
	Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950)
				
					
				
			Close #22847 This PR: * introduce Gitea's own `showElem` and related functions * remove jQuery show/hide * remove .hide class * remove inline style=display:none From now on: do not use: * "[hidden]" attribute: it's too weak, can not be applied to an element with "display: flex" * ".hidden" class: it has been polluted by Fomantic UI in many cases * inline style="display: none": it's difficult to tweak * jQuery's show/hide/toggle: it can not show/hide elements with "display: xxx !important" only use: * this ".gt-hidden" class * showElem/hideElem/toggleElem functions in "utils/dom.js" cc: @silverwind , this is the all-in-one PR
This commit is contained in:
		| @@ -16,7 +16,7 @@ function showContentHistoryDetail(issueBaseUrl, commentId, historyId, itemTitleH | ||||
|   ${svg('octicon-x', 16, 'close icon inside')} | ||||
|   <div class="header gt-df gt-ac gt-sb"> | ||||
|     <div>${itemTitleHtml}</div> | ||||
|     <div class="ui dropdown dialog-header-options gt-df gt-ac gt-mr-5 hide"> | ||||
|     <div class="ui dropdown dialog-header-options gt-df gt-ac gt-mr-5 gt-hidden"> | ||||
|       ${i18nTextOptions}${svg('octicon-triangle-down', 14, 'dropdown icon')} | ||||
|       <div class="menu"> | ||||
|         <div class="item red text" data-option-item="delete">${i18nTextDeleteFromHistory}</div> | ||||
| @@ -62,7 +62,7 @@ function showContentHistoryDetail(issueBaseUrl, commentId, historyId, itemTitleH | ||||
|         $dialog.find('.comment-diff-data').removeClass('is-loading').html(resp.diffHtml); | ||||
|         // there is only one option "item[data-option-item=delete]", so the dropdown can be entirely shown/hidden. | ||||
|         if (resp.canSoftDelete) { | ||||
|           $dialog.find('.dialog-header-options').removeClass('hide'); | ||||
|           $dialog.find('.dialog-header-options').removeClass('gt-hidden'); | ||||
|         } | ||||
|       }); | ||||
|     }, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user