mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	Forbid jQuery .prop and fix related issues (#29832)
				
					
				
			The issue checkbox code received a few more cleanups and I specifically tested it. The other changes are trivial. Also, I checked the cases for how many elements match the jQuery selection to determine querySelector vs. querySelectorAll. --------- Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
		| @@ -14,7 +14,7 @@ function updateExclusiveLabelEdit(form) { | ||||
|   if (isExclusiveScopeName($nameInput.val())) { | ||||
|     $exclusiveField.removeClass('muted'); | ||||
|     $exclusiveField.removeAttr('aria-disabled'); | ||||
|     if ($exclusiveCheckbox.prop('checked') && $exclusiveCheckbox.data('exclusive-warn')) { | ||||
|     if ($exclusiveCheckbox[0].checked && $exclusiveCheckbox.data('exclusive-warn')) { | ||||
|       $exclusiveWarning.removeClass('gt-hidden'); | ||||
|     } else { | ||||
|       $exclusiveWarning.addClass('gt-hidden'); | ||||
| @@ -50,10 +50,10 @@ export function initCompLabelEdit(selector) { | ||||
|     $nameInput.val($(this).data('title')); | ||||
|  | ||||
|     const $isArchivedCheckbox = $('.edit-label .label-is-archived-input'); | ||||
|     $isArchivedCheckbox.prop('checked', this.hasAttribute('data-is-archived')); | ||||
|     $isArchivedCheckbox[0].checked = this.hasAttribute('data-is-archived'); | ||||
|  | ||||
|     const $exclusiveCheckbox = $('.edit-label .label-exclusive-input'); | ||||
|     $exclusiveCheckbox.prop('checked', this.hasAttribute('data-exclusive')); | ||||
|     $exclusiveCheckbox[0].checked = this.hasAttribute('data-exclusive'); | ||||
|     // Warn when label was previously not exclusive and used in issues | ||||
|     $exclusiveCheckbox.data('exclusive-warn', | ||||
|       $(this).data('num-issues') > 0 && | ||||
|   | ||||
		Reference in New Issue
	
	Block a user