Merge pull request #2569 from mempool/simon/clipboard-button-fix
Clipboard buttons fix
This commit is contained in:
		
						commit
						c4760578a4
					
				@ -1,5 +1,15 @@
 | 
			
		||||
<span #buttonWrapper [attr.data-tlite]="copiedMessage" style="position: relative;">
 | 
			
		||||
<ng-template [ngIf]="button" [ngIfElse]="btnLink">
 | 
			
		||||
  <button #btn [attr.data-clipboard-text]="text" [class]="class" type="button" [disabled]="text === ''">
 | 
			
		||||
    <span #buttonWrapper [attr.data-tlite]="copiedMessage" style="position: relative;top: -2px;left: 1px;">
 | 
			
		||||
      <app-svg-images name="clippy" [width]="size === 'small' ? '10' : '13'" viewBox="0 0 1000 1000"></app-svg-images>
 | 
			
		||||
    </span>
 | 
			
		||||
  </button>
 | 
			
		||||
</ng-template>
 | 
			
		||||
 | 
			
		||||
<ng-template #btnLink>
 | 
			
		||||
  <span #buttonWrapper [attr.data-tlite]="copiedMessage" style="position: relative;">
 | 
			
		||||
    <button #btn class="btn btn-sm btn-link pt-0 {{ leftPadding ? 'padding' : '' }}" [attr.data-clipboard-text]="text"> 
 | 
			
		||||
      <app-svg-images name="clippy" [width]="size === 'small' ? '10' : '13'" viewBox="0 0 1000 1000"></app-svg-images>
 | 
			
		||||
    </button>
 | 
			
		||||
</span>
 | 
			
		||||
  </span>
 | 
			
		||||
</ng-template>
 | 
			
		||||
 | 
			
		||||
@ -11,6 +11,8 @@ import * as tlite from 'tlite';
 | 
			
		||||
export class ClipboardComponent implements AfterViewInit {
 | 
			
		||||
  @ViewChild('btn') btn: ElementRef;
 | 
			
		||||
  @ViewChild('buttonWrapper') buttonWrapper: ElementRef;
 | 
			
		||||
  @Input() button = false;
 | 
			
		||||
  @Input() class = 'btn btn-secondary ml-1';
 | 
			
		||||
  @Input() size: 'small' | 'normal' = 'normal';
 | 
			
		||||
  @Input() text: string;
 | 
			
		||||
  @Input() leftPadding = true;
 | 
			
		||||
 | 
			
		||||
@ -99,9 +99,7 @@
 | 
			
		||||
                  <app-qrcode [size]="200" [data]="node.socketsObject[selectedSocketIndex].socket"></app-qrcode>
 | 
			
		||||
                </div>
 | 
			
		||||
              </button>
 | 
			
		||||
              <button class="btn btn-secondary ml-1" type="button" id="inputGroupFileAddon04">
 | 
			
		||||
                <app-clipboard [text]="node.socketsObject[selectedSocketIndex].socket" [leftPadding]="false"></app-clipboard>
 | 
			
		||||
              </button>
 | 
			
		||||
              <app-clipboard [button]="true" [text]="node.socketsObject[selectedSocketIndex].socket" [leftPadding]="false"></app-clipboard>
 | 
			
		||||
            </div>
 | 
			
		||||
          </td>
 | 
			
		||||
          <td class="city text-right text-truncate d-none d-md-table-cell">
 | 
			
		||||
 | 
			
		||||
@ -120,9 +120,7 @@
 | 
			
		||||
        <app-qrcode [size]="200" [data]="node.socketsObject[selectedSocketIndex].socket"></app-qrcode>
 | 
			
		||||
      </div>
 | 
			
		||||
    </button>
 | 
			
		||||
    <button class="btn btn-secondary ml-1" type="button" id="inputGroupFileAddon04">
 | 
			
		||||
      <app-clipboard [text]="node.socketsObject[selectedSocketIndex].socket" [leftPadding]="false"></app-clipboard>
 | 
			
		||||
    </button>
 | 
			
		||||
    <app-clipboard [button]="true" [text]="node.socketsObject[selectedSocketIndex].socket" [leftPadding]="false"></app-clipboard>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <div *ngIf="!error">
 | 
			
		||||
@ -230,9 +228,7 @@
 | 
			
		||||
      <button class="btn btn-secondary ml-1" type="button" id="inputGroupFileAddon04" [disabled]="true">
 | 
			
		||||
        <fa-icon [icon]="['fas', 'qrcode']" [fixedWidth]="true"></fa-icon>
 | 
			
		||||
      </button>
 | 
			
		||||
      <button class="btn btn-secondary ml-1" type="button" id="inputGroupFileAddon04" [disabled]="true">
 | 
			
		||||
        <app-clipboard [text]="''"></app-clipboard>
 | 
			
		||||
      </button>
 | 
			
		||||
      <app-clipboard [button]="true" [text]="''"></app-clipboard>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <br>
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user