mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00:00 
			
		
		
		
	Remove jQuery .map() and enable eslint rules for it (#29272)
- Use case in `repo-commit` was tested until the point where the POST request was sent with the same payload. - Use case in `repo-legacy` was tested completely with comment editing. - `jquery/no-fade` was disabled as well to stay in sync with `no-jquery/no-fade`, had no violations.
This commit is contained in:
		@@ -398,17 +398,14 @@ async function onEditContent(event) {
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  const saveAndRefresh = (dz, $dropzone) => {
 | 
			
		||||
  const saveAndRefresh = (dz) => {
 | 
			
		||||
    showElem($renderContent);
 | 
			
		||||
    hideElem($editContentZone);
 | 
			
		||||
    const $attachments = $dropzone.find('.files').find('[name=files]').map(function () {
 | 
			
		||||
      return $(this).val();
 | 
			
		||||
    }).get();
 | 
			
		||||
    $.post($editContentZone.attr('data-update-url'), {
 | 
			
		||||
      _csrf: csrfToken,
 | 
			
		||||
      content: comboMarkdownEditor.value(),
 | 
			
		||||
      context: $editContentZone.attr('data-context'),
 | 
			
		||||
      files: $attachments,
 | 
			
		||||
      files: dz.files.map((file) => file.uuid),
 | 
			
		||||
    }, (data) => {
 | 
			
		||||
      if (!data.content) {
 | 
			
		||||
        $renderContent.html($('#no-content').html());
 | 
			
		||||
@@ -452,7 +449,7 @@ async function onEditContent(event) {
 | 
			
		||||
    });
 | 
			
		||||
    $editContentZone.find('.save.button').on('click', (e) => {
 | 
			
		||||
      e.preventDefault();
 | 
			
		||||
      saveAndRefresh(dz, $dropzone);
 | 
			
		||||
      saveAndRefresh(dz);
 | 
			
		||||
    });
 | 
			
		||||
  } else {
 | 
			
		||||
    comboMarkdownEditor = getComboMarkdownEditor($editContentZone.find('.combo-markdown-editor'));
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user