Skip to content

Commit

Permalink
better fix for trash
Browse files Browse the repository at this point in the history
  • Loading branch information
N6REJ committed Aug 25, 2020
1 parent b2648c4 commit 3cbf5ac
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions layouts/joomla/button/iconclass.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

if(strpos($icon, 'fa-') !== false)
{
$icon = 'fas ' . $icon;
$icon = 'fas ' . str_ireplace('fas ','', $icon);
}
elseif(strpos($icon, 'icon-') !== false)
elseif (strpos($icon, 'icon-') !== false)
{
$icon = $icon;
}
elseif ($icon === 'archive' || $icon === 'folder-close' || $icon === 'folder-folder-2' || $icon === 'folder-minus' || $icon === 'folder-plus-2' || $icon === 'folder-remove' || $icon === 'drawer-2')
elseif ($icon === 'archive' || $icon === 'folder-close' || $icon === 'folder-folder-2' || $icon === 'folder-minus' || $icon === 'folder-plus-2' || $icon === 'folder-remove' || $icon === 'drawer-2')
{
$icon = 'fas fa-folder';
}
Expand Down Expand Up @@ -72,7 +72,7 @@
{
$icon = 'fas fa-compress';
}
elseif ($icon === 'purge' || $icon === 'trash')
elseif ($icon === 'purge')
{
$icon = 'fas fa-trash';
}
Expand Down
4 changes: 2 additions & 2 deletions layouts/joomla/toolbar/iconclass.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

if(strpos($icon, 'fa-') !== false)
{
$icon = 'fas ' . $icon;
$icon = 'fas ' . str_ireplace('fas ','', $icon);
}
elseif(strpos($icon, 'icon-') !== false)
{
Expand Down Expand Up @@ -72,7 +72,7 @@
{
$icon = 'fas fa-compress';
}
elseif ($icon === 'purge' || $icon === 'trash')
elseif ($icon === 'purge')
{
$icon = 'fas fa-trash';
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Toolbar/CoreButtonsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ public function delete(string $task, string $text = 'JTOOLBAR_DELETE'): ConfirmB
*/
public function trash(string $task, string $text = 'JTOOLBAR_TRASH'): StandardButton
{
return $this->standardButton('trash', $text)
return $this->standardButton('fa-trash', $text)
->task($task);
}

Expand Down
1 change: 1 addition & 0 deletions libraries/src/Toolbar/ToolbarButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ protected function renderButton(array &$options): string

// Isolate button class from icon class
$buttonClass = str_replace('fas fa-', '', $this->getName());
$buttonClass = str_ireplace('fa-', '', $buttonClass);
$iconclass = $options['btnClass'] ?? '';
$options['btnClass'] = 'button-' . $buttonClass . ' ' . $iconclass;

Expand Down

0 comments on commit 3cbf5ac

Please sign in to comment.