Skip to content

Commit

Permalink
Use filename data
Browse files Browse the repository at this point in the history
  • Loading branch information
timkelty committed May 19, 2023
1 parent f7542be commit 1626de6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/elements/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -2928,6 +2928,7 @@ protected function htmlAttributes(string $context): array
'data' => [
'kind' => $this->kind,
'alt' => $this->alt,
'filename' => $this->filename,
],
];

Expand Down
6 changes: 1 addition & 5 deletions src/elements/actions/RenameFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ public function getTriggerHtml(): ?string
activate: \$selectedItems => {
const \$element = \$selectedItems.find('.element')
const assetId = \$element.data('id');
let oldName = \$element.data('url').split('/').pop();
if (oldName.indexOf('?') !== -1) {
oldName = oldName.split('?').shift();
}
let oldName = \$element.data('filename');
const newName = prompt($prompt, oldName);
Expand Down

0 comments on commit 1626de6

Please sign in to comment.