Open current tab after refresh page

This commit is contained in:
Diego Najar 2019-09-25 20:18:36 +02:00
parent bf0f31993b
commit b35172b286
5 changed files with 33 additions and 20 deletions

View File

@ -57,8 +57,6 @@ div.sidebar .nav-item h4 {
padding-top: 2px;
}
/*
BOOTSTRAP Hacks
*/

View File

@ -12,25 +12,29 @@
<!-- CSS -->
<?php
echo Theme::cssBootstrap(); // Bootstrap
echo Theme::cssLineAwesome(); // Icons
echo Theme::cssBootstrap();
echo Theme::cssLineAwesome();
echo Theme::css(array(
'jquery-auto-complete.css',
'jquery.datetimepicker.min.css',
'bludit.css',
'bludit.bootstrap.css'
), DOMAIN_ADMIN_THEME_CSS);
echo Theme::css(array(
'jquery.datetimepicker.min.css',
'select2.min.css',
'select2-bootstrap4.min.css'
), DOMAIN_CORE_CSS);
?>
<!-- Javascript -->
<?php
echo Theme::jquery();
echo Theme::jsBootstrap();
echo Theme::js(array(
'jquery-auto-complete.min.js',
'jquery.datetimepicker.full.min.js'
), DOMAIN_ADMIN_THEME_JS);
echo Theme::jsSortable();
echo Theme::js(array(
'jquery.datetimepicker.full.min.js',
'select2.full.min.js',
'functions.js'
), DOMAIN_CORE_JS);
?>
<!-- Plugins -->
@ -48,10 +52,6 @@
include(PATH_CORE_JS.'variables.php');
echo '</script>'.PHP_EOL;
echo '<script charset="utf-8">'.PHP_EOL;
include(PATH_CORE_JS.'functions.php');
echo '</script>'.PHP_EOL;
echo '<script charset="utf-8">'.PHP_EOL;
include(PATH_CORE_JS.'bludit-ajax.php');
echo '</script>'.PHP_EOL;
@ -89,11 +89,8 @@
</div>
</div>
<!-- Check user logged and Internet connection -->
<?php include('html/user-logged.php'); ?>
<!-- Plugins -->
<?php Theme::plugins('adminBodyEnd') ?>
</body>
</html>
</html>

View File

@ -180,7 +180,7 @@ EOF;
$html = '<div class="form-group row">';
if (isset($args['label'])) {
if (!empty($args['label'])) {
$html .= '<label for="'.$id.'" class="col-sm-2 col-form-label">'.$args['label'].'</label>';
}

View File

@ -272,4 +272,19 @@
</div>
</div>
<?php echo Bootstrap::formClose(); ?>
<?php echo Bootstrap::formClose(); ?>
<script>
// Open current tab after refresh page
$(function() {
$('a[data-toggle="tab"]').on('click', function(e) {
window.localStorage.setItem('activeTab', $(e.target).attr('href'));
console.log($(e.target).attr('href'));
});
var activeTab = window.localStorage.getItem('activeTab');
if (activeTab) {
$('#nav-tab a[href="' + activeTab + '"]').tab('show');
window.localStorage.removeItem("activeTab");
}
});
</script>

View File

@ -213,8 +213,10 @@ echo Bootstrap::formOpen(array(
'disabled'=>true
));
?>
<script>
$(document).ready(function() {
// Changes in External cover image input
$("#jsexternalCoverImage").change(function() {
$("#jscoverImage").val( $(this).val() );
@ -366,6 +368,7 @@ echo Bootstrap::formOpen(array(
}
?>
<!-- Title -->
<div id="jseditorTitle" class="form-group mb-1">
<input id="jstitle" name="title" type="text" class="form-control form-control-lg rounded-0" value="" placeholder="<?php $L->p('Enter title') ?>">