Skip to content

Commit 607b899

Browse files
rickiewarsRick
and
Rick
authored
add configurable option to open telescope links in new tab (#81)
* add configurable option to open telescope links in new tab * revert accidental change by formatter * remove whitespace --------- Co-authored-by: Rick <5411140-rickiewars@users.noreply.gitlab.com>
1 parent 66920cb commit 607b899

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

config/telescope-toolbar.php

+12
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@
3939
*/
4040
'light_theme' => env('TELESCOPE_LIGHT_THEME', false),
4141

42+
/*
43+
|--------------------------------------------------------------------------
44+
| Open links in new tab
45+
|--------------------------------------------------------------------------
46+
|
47+
| This option enabled/disables opening telescope links in a new tab.
48+
| By default, clicking on a tab will open telescope in the same tab.
49+
| Values be: true, false
50+
|
51+
*/
52+
'new_tab' => env('TELESCOPE_TOOLBAR_NEW_TAB', false),
53+
4254
/*
4355
|--------------------------------------------------------------------------
4456
| Route path of Toolbar

resources/views/item.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
$link = $ttLink . $link;
99
}
1010
@endphp
11-
<a href="{{ $link }}">
11+
<a href="{{ $link }}" {{ config('telescope-toolbar.new_tab') ? 'target="_blank"' : '' }}>
1212
@endif
1313
<div class="sf-toolbar-icon">{{ $icon ?? '' }}</div>
1414
@if(isset($link) && $link)</a>@endif

0 commit comments

Comments
 (0)