Skip to content

Commit 7ae894d

Browse files
committed
Fixed bug on copying with copyToClipboard
1 parent 9ea6634 commit 7ae894d

10 files changed

+11
-12
lines changed

public/assets/dashboard.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ loadTooltips();
1010

1111
function copyToClipboard(copyButtonId = 'copyButton') {
1212
// Find the <pre> tag content
13-
const codecontentId = copyButtonId + (copyButtonId !== 'copyButton' ? '-code' : '');
14-
const codeContent = document.getElementById(codecontentId).innerText;
13+
const codeContent = document.getElementById(copyButtonId + '-code').innerText;
1514

1615
// Create a temporary textarea element to hold the content
1716
const tempTextArea = document.createElement("textarea");

public/pages/mathematics-for-ml/matrices/mathphp-matrix-operations-run.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</button>
4141
&nbsp;
4242
</div>
43-
<div class="code-wrapper">
43+
<div id="copyButton-code" class="code-wrapper">
4444
<code id="code">
4545
<?= highlight_file(dirname(__FILE__) . '/mathphp-matrix-operations-usage.php', true); ?>
4646
</code>

public/pages/mathematics-for-ml/matrices/php-matrix-operations-run.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</button>
4141
&nbsp;
4242
</div>
43-
<div class="code-wrapper">
43+
<div id="copyButton-code" class="code-wrapper">
4444
<code id="code">
4545
<?= highlight_file(dirname(__FILE__) . '/php-matrix-operations-usage.php', true); ?>
4646
</code>

public/pages/mathematics-for-ml/matrices/rubix-matrix-operations-run.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</button>
4141
&nbsp;
4242
</div>
43-
<div class="code-wrapper">
43+
<div id="copyButton-code" class="code-wrapper">
4444
<code id="code">
4545
<?= highlight_file(dirname(__FILE__) . '/rubix-matrix-operations-usage.php', true); ?>
4646
</code>

public/pages/mathematics-for-ml/matrices/rubix-tensor-matrix-operations-run.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</button>
4141
&nbsp;
4242
</div>
43-
<div class="code-wrapper">
43+
<div id="copyButton-code" class="code-wrapper">
4444
<code id="code">
4545
<?= highlight_file(dirname(__FILE__) . '/rubix-tensor-matrix-operations-usage.php', true); ?>
4646
</code>

public/pages/mathematics-for-ml/vectors/mathphp-vector-operations-run.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
</button>
4646
&nbsp;
4747
</div>
48-
<div class="code-wrapper">
48+
<div id="copyButton-code" class="code-wrapper">
4949
<code id="code">
5050
<?= highlight_file(dirname(__FILE__) . '/mathphp-vector-operations-usage.php', true); ?>
5151
</code>

public/pages/mathematics-for-ml/vectors/php-vector-operations-run.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@
4747
</button>
4848
&nbsp;
4949
</div>
50-
<div class="code-wrapper">
50+
<div id="copyButton-code" class="code-wrapper">
5151
<code id="code">
5252
<?= highlight_file(dirname(__FILE__) . '/php-vector-operations-usage.php', true); ?>
5353
</code>
54-
</div>
54+
</di>
5555
</div>
5656
</div>
5757

public/pages/mathematics-for-ml/vectors/rubix-tensor-vector-operations-run.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
</button>
4848
&nbsp;
4949
</div>
50-
<div class="code-wrapper">
50+
<div id="copyButton-code" class="code-wrapper">
5151
<code id="code">
5252
<?= highlight_file(dirname(__FILE__) . '/rubix-tensor-vector-operations-usage.php', true); ?>
5353
</code>

public/pages/mathematics-for-ml/vectors/rubix-vector-operations-run.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
</button>
4747
&nbsp;
4848
</div>
49-
<div class="code-wrapper">
49+
<div id="copyButton-code" class="code-wrapper">
5050
<code id="code">
5151
<?= highlight_file(dirname(__FILE__) . '/rubix-vector-operations-usage.php', true); ?>
5252
</code>

public/pages/problem-solving/uninformed-search/bidirectional-search-code-run.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
</button>
5252
&nbsp;
5353
</div>
54-
<div class="code-wrapper">
54+
<div id="copyButton-code" class="code-wrapper">
5555
<code id="code">
5656
<?= highlight_file(dirname(__FILE__) . '/bidirectional-search-code-usage.php', true); ?>
5757
</code>

0 commit comments

Comments
 (0)