Prevent the irritating moment when you logout accidentally when trying to click Admin CP.

This commit is contained in:
Dane Everitt 2017-06-18 20:47:34 -05:00
parent 1c5f892049
commit 81d265db08
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
2 changed files with 24 additions and 2 deletions

View file

@ -79,7 +79,7 @@
<li><a href="{{ route('index') }}" data-toggle="tooltip" data-placement="bottom" title="Exit Admin Control"><i class="fa fa-server"></i></a></li> <li><a href="{{ route('index') }}" data-toggle="tooltip" data-placement="bottom" title="Exit Admin Control"><i class="fa fa-server"></i></a></li>
</li> </li>
<li> <li>
<li><a href="{{ route('auth.logout') }}" data-toggle="tooltip" data-placement="bottom" title="Logout"><i class="fa fa-power-off"></i></a></li> <li><a href="{{ route('auth.logout') }}" id="logoutButton" data-toggle="tooltip" data-placement="bottom" title="Logout"><i class="fa fa-power-off"></i></a></li>
</li> </li>
</ul> </ul>
</div> </div>
@ -191,6 +191,17 @@
{!! Theme::js('vendor/select2/select2.full.min.js') !!} {!! Theme::js('vendor/select2/select2.full.min.js') !!}
{!! Theme::js('js/admin/functions.js') !!} {!! Theme::js('js/admin/functions.js') !!}
{!! Theme::js('js/autocomplete.js') !!} {!! Theme::js('js/autocomplete.js') !!}
@if(Auth::user()->isRootAdmin())
<script>
$('#logoutButton').on('click', function (event) {
event.preventDefault();
if (confirm('Are you sure you want to logout?')) {
window.location = $(this).attr('href');
}
});
</script>
@endif
@show @show
</body> </body>
</html> </html>

View file

@ -83,7 +83,7 @@
</li> </li>
@endif @endif
<li> <li>
<li><a href="{{ route('auth.logout') }}" data-toggle="tooltip" data-placement="bottom" title="{{ @trans('strings.logout') }}"><i class="fa fa-power-off"></i></a></li> <li><a href="{{ route('auth.logout') }}" id="logoutButton" data-toggle="tooltip" data-placement="bottom" title="{{ @trans('strings.logout') }}"><i class="fa fa-power-off"></i></a></li>
</li> </li>
</ul> </ul>
</div> </div>
@ -283,6 +283,17 @@
@if(config('pterodactyl.lang.in_context')) @if(config('pterodactyl.lang.in_context'))
{!! Theme::js('vendor/phraseapp/phraseapp.js') !!} {!! Theme::js('vendor/phraseapp/phraseapp.js') !!}
@endif @endif
@if(Auth::user()->isRootAdmin())
<script>
$('#logoutButton').on('click', function (event) {
event.preventDefault();
if (confirm('Are you sure you want to logout?')) {
window.location = $(this).attr('href');
}
});
</script>
@endif
@show @show
</body> </body>
</html> </html>