"Open the tab defined in the URL" compatibility
- Better compatibility by not using ``` - If page is scrollable, prevent jumping down past the tabs
This commit is contained in:
parent
9b7400b250
commit
f307237855
@ -85,7 +85,7 @@ function table($type) {
|
|||||||
$friendlyURL = Text::isEmpty($url->filters('page')) ? '/'.$page->key() : '/'.$url->filters('page').'/'.$page->key();
|
$friendlyURL = Text::isEmpty($url->filters('page')) ? '/'.$page->key() : '/'.$url->filters('page').'/'.$page->key();
|
||||||
echo '<td class="d-none d-lg-table-cell"><a target="_blank" href="'.$page->permalink().'">'.$friendlyURL.'</a></td>';
|
echo '<td class="d-none d-lg-table-cell"><a target="_blank" href="'.$page->permalink().'">'.$friendlyURL.'</a></td>';
|
||||||
|
|
||||||
echo '<td class="pt-3 text-center d-none d-sm-table-cell w-25">'.PHP_EOL;
|
echo '<td id="jscontentTools" class="pt-3 text-center d-none d-sm-table-cell w-25">'.PHP_EOL;
|
||||||
echo '<a class="btn btn-outline-secondary btn-sm mb-1" href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'"><span class="oi oi-pencil"></span> '.$L->g('Edit').'</a>'.PHP_EOL;
|
echo '<a class="btn btn-outline-secondary btn-sm mb-1" href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'"><span class="oi oi-pencil"></span> '.$L->g('Edit').'</a>'.PHP_EOL;
|
||||||
if (count($page->children())==0) {
|
if (count($page->children())==0) {
|
||||||
echo '<button type="button" class="btn btn-outline-danger btn-sm deletePageButton mb-1" data-toggle="modal" data-target="#jsdeletePageModal" data-key="'.$page->key().'"><span class="oi oi-trash"></span> '.$L->g('Delete').'</button>'.PHP_EOL;
|
echo '<button type="button" class="btn btn-outline-danger btn-sm deletePageButton mb-1" data-toggle="modal" data-target="#jsdeletePageModal" data-key="'.$page->key().'"><span class="oi oi-trash"></span> '.$L->g('Delete').'</button>'.PHP_EOL;
|
||||||
@ -143,7 +143,7 @@ function table($type) {
|
|||||||
$friendlyURL = Text::isEmpty($url->filters('page')) ? '/'.$page->key() : '/'.$url->filters('page').'/'.$page->key();
|
$friendlyURL = Text::isEmpty($url->filters('page')) ? '/'.$page->key() : '/'.$url->filters('page').'/'.$page->key();
|
||||||
echo '<td class="pt-3 d-none d-lg-table-cell"><a target="_blank" href="'.$page->permalink().'">'.$friendlyURL.'</a></td>';
|
echo '<td class="pt-3 d-none d-lg-table-cell"><a target="_blank" href="'.$page->permalink().'">'.$friendlyURL.'</a></td>';
|
||||||
|
|
||||||
echo '<td class="pt-3 text-center d-none d-sm-table-cell w-25">'.PHP_EOL;
|
echo '<td id="jscontentTools" class="pt-3 text-center d-sm-table-cell w-25">'.PHP_EOL;
|
||||||
echo '<a class="btn btn-outline-secondary btn-sm mb-1" href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'"><span class="oi oi-pencil"></span> '.$L->g('Edit').'</a>'.PHP_EOL;
|
echo '<a class="btn btn-outline-secondary btn-sm mb-1" href="'.HTML_PATH_ADMIN_ROOT.'edit-content/'.$page->key().'"><span class="oi oi-pencil"></span> '.$L->g('Edit').'</a>'.PHP_EOL;
|
||||||
if (count($page->children())==0) {
|
if (count($page->children())==0) {
|
||||||
echo '<button type="button" class="btn btn-outline-danger btn-sm deletePageButton mb-1" data-toggle="modal" data-target="#jsdeletePageModal" data-key="'.$page->key().'"><span class="oi oi-trash"></span> '.$L->g('Delete').'</button>'.PHP_EOL;
|
echo '<button type="button" class="btn btn-outline-danger btn-sm deletePageButton mb-1" data-toggle="modal" data-target="#jsdeletePageModal" data-key="'.$page->key().'"><span class="oi oi-trash"></span> '.$L->g('Delete').'</button>'.PHP_EOL;
|
||||||
@ -283,5 +283,9 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
form.hide().appendTo("body").submit();
|
form.hide().appendTo("body").submit();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Open the tab defined in the URL
|
||||||
|
$('a[href="'+ window.location.hash +'"]').tab('show');
|
||||||
|
window.scrollTo(0);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
@ -345,6 +345,9 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Open the tab defined in the URL
|
||||||
|
$('a[href="'+ window.location.hash +'"]').tab('show');
|
||||||
|
window.scrollTo(0);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -537,9 +540,3 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php echo Bootstrap::formClose(); ?>
|
<?php echo Bootstrap::formClose(); ?>
|
||||||
|
|
||||||
<script>
|
|
||||||
// Open the tab defined in the URL
|
|
||||||
const anchor = window.location.hash;
|
|
||||||
$(`a[href="${anchor}"]`).tab('show');
|
|
||||||
</script>
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user