"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:
parent
de61816623
commit
0208ea0248
5 changed files with 24 additions and 9 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue