mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	"Copy branch name" button in pull request (#17323)
* Drop data-original from clipboard data-original attribute was removed. Instead, the original value from data-content is set after success/fail message was displayed. Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * "Copy branch name" button in pull request Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Update templates/repo/issue/view_title.tmpl Co-authored-by: silverwind <me@silverwind.io> * Apply suggestions from code review Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
		@@ -4,16 +4,18 @@
 | 
			
		||||
function onSuccess(btn) {
 | 
			
		||||
  if (!btn.dataset.content) return;
 | 
			
		||||
  $(btn).popup('destroy');
 | 
			
		||||
  const oldContent = btn.dataset.content;
 | 
			
		||||
  btn.dataset.content = btn.dataset.success;
 | 
			
		||||
  $(btn).popup('show');
 | 
			
		||||
  btn.dataset.content = btn.dataset.original;
 | 
			
		||||
  btn.dataset.content = oldContent;
 | 
			
		||||
}
 | 
			
		||||
function onError(btn) {
 | 
			
		||||
  if (!btn.dataset.content) return;
 | 
			
		||||
  const oldContent = btn.dataset.content;
 | 
			
		||||
  $(btn).popup('destroy');
 | 
			
		||||
  btn.dataset.content = btn.dataset.error;
 | 
			
		||||
  $(btn).popup('show');
 | 
			
		||||
  btn.dataset.content = btn.dataset.original;
 | 
			
		||||
  btn.dataset.content = oldContent;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 
 | 
			
		||||
@@ -686,6 +686,15 @@
 | 
			
		||||
      code {
 | 
			
		||||
        color: var(--color-primary);
 | 
			
		||||
      }
 | 
			
		||||
      a[data-clipboard-text] {
 | 
			
		||||
        cursor: pointer;
 | 
			
		||||
        svg {
 | 
			
		||||
          vertical-align: middle;
 | 
			
		||||
          position: relative;
 | 
			
		||||
          top: -2px;
 | 
			
		||||
          right: 1px;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .pull {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user