File tree Expand file tree Collapse file tree 4 files changed +9
-47
lines changed Expand file tree Collapse file tree 4 files changed +9
-47
lines changed Original file line number Diff line number Diff line change 22 <div >
33 <button
44 type =" button"
5- class ="
6- inline-flex
7- items-center
8- justify-center
9- gap-1
10- p-2
11- text-sm
12- transition-transform
13- transform
14- rounded-md
15- shadow
16- outline-none
17- justify-self-end
18- focus:ring-4
19- active:scale-y-75
20- hover:scale-105 hover:shadow-lg
21- copy-uri-button
22- "
5+ class =" inline-flex items-center justify-center gap-1 p-2 text-sm transition-transform transform rounded-md shadow outline-none justify-self-end focus:ring-4 active:scale-y-75 hover:scale-105 hover:shadow-lg copy-uri-button"
236 aria-label =" Click here to copy url to clipboard"
247 id =" copyLinkButton"
258 :class =" {
Original file line number Diff line number Diff line change 22 <div id =" prevDiffSection" class =" inline-flex items-center gap-1" >
33 <button
44 id =" prevDiff"
5- class =" inline-flex items-center justify-center px-1 py-1 text-sm text-gray-600 transition-transform transform bg-gray-300 border border-gray-800 rounded-sm outline-none dark:border-gray-400 dark:text-white dark:bg-gray-800 align-center focus:ring-4 active:scale-y-75 hover:scale-105 hover:shadow-lg"
5+ class =" inline-flex items-center justify-center px-1 py-1 text-sm text-gray-600 transition-transform transform bg-gray-300 border border-gray-800 rounded-sm outline-none dark:border-gray-400 dark:text-white dark:bg-gray-800 align-center focus:ring-4 active:scale-y-75 hover:scale-105 hover:shadow-lg"
66 aria-label =" Go to previous diff"
77 type =" button"
88 @click =" clickHandler"
Original file line number Diff line number Diff line change 11<template >
22 <section
3- class ="
4- flex
5- items-center
6- justify-between
7- px-4
8- py-2
9- mb-4
10- sticky
11- top-[70px]
12- dark:bg-gray-700
13- bg-gray-300
14- dark:bg-opacity-50
15- bg-opacity-50
16- backdrop-blur-sm
17- rounded-md
18- shadow-lg
19- border border-gray-500
20- w-full
21- z-10
22- "
3+ class =" flex items-center justify-between px-4 py-2 mb-4 sticky top-[70px] dark:bg-gray-700 bg-gray-300 dark:bg-opacity-50 bg-opacity-50 backdrop-blur-sm rounded-md shadow-lg border border-gray-500 w-full z-10"
234 >
245 <div class =" flex gap-4" >
256 <ToggleInSync />
@@ -92,7 +73,11 @@ export default Vue.extend({
9273 methods: {
9374 handleCtrlC(event : KeyboardEvent ) {
9475 const { metaKey, ctrlKey, key } = event
95- if ((metaKey || ctrlKey ) && key === ' c' ) {
76+ if (
77+ (metaKey || ctrlKey ) &&
78+ key === ' c' &&
79+ ! window ?.getSelection ()?.toString ()
80+ ) {
9681 const button: HTMLButtonElement = document .getElementById (
9782 ' copyLinkButton'
9883 ) as HTMLButtonElement
Original file line number Diff line number Diff line change 55 </p >
66 <div
77 :id =" id"
8- class =" relative flex-1 px-4 py-2 border-2 rounded-md dark:border-gray-500 line-number-gutter min-h-80"
8+ class =" relative flex-1 px-4 py-2 border-2 rounded-md dark:border-gray-500 line-number-gutter min-h-80"
99 :class =" {
1010 'overflow-y-auto max-h-screen--nav': !isSrollInSyncEnabled,
1111 }"
1212 >
13- <StickyCopy
14- :aria-label =" 'Copy the content to clipboard'"
15- :click-handler =" copyTextToClipboard"
16- />
1713 <div
1814 v-for =" (lineDiff, index) in diff"
1915 :key =" index"
3026
3127<script lang="ts">
3228import Vue from ' vue'
33- import StickyCopy from ' ./buttons/stickyCopy.vue'
3429import { putToClipboard } from ' ~/helpers/utils'
3530export default Vue .extend ({
36- components: { StickyCopy },
3731 props: {
3832 diff: {
3933 type: Array ,
You can’t perform that action at this time.
0 commit comments