Skip to content

Commit

Permalink
Merge pull request #28 from adinhodovic/fix-use-current-target
Browse files Browse the repository at this point in the history
fix: Use current target for actions
  • Loading branch information
adinhodovic committed Feb 29, 2024
2 parents f6e3332 + ef41b93 commit 08cce7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions django_admin_shellx/static/django_admin_shellx/js/terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ terminal.attachCustomKeyEventHandler((arg) => {
});

function copyTextToClipboard(event) {
navigator.clipboard.writeText(event.target.dataset.command);
navigator.clipboard.writeText(event.currentTarget.dataset.command);
}

var copyButtons = document.querySelectorAll("#djw_copy_command");
Expand Down Expand Up @@ -282,8 +282,8 @@ commandHistoryTabs.forEach((button) => {
});

function executeCommand(event) {
const command = event.target.dataset.command;
const prompt = event.target.dataset.prompt;
const command = event.currentTarget.dataset.command;
const prompt = event.currentTarget.dataset.prompt;

if (command) {
const json_data = JSON.stringify({
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "django-admin-shellx"
version = "0.2.5"
version = "0.2.6"
description = "A Django Admin Shell"
authors = ["Adin Hodovic <hodovicadin@gmail.com>"]
license = "MIT"
Expand Down

0 comments on commit 08cce7c

Please sign in to comment.