* Adjust floatprenextbtn.
This commit is contained in:
@@ -1,24 +1,24 @@
|
||||
function updateBtnPosition(margin)
|
||||
function updateBtnPosition(margin, offset)
|
||||
{
|
||||
const preBtn = document.querySelector('#preButton');
|
||||
const nextBtn = document.querySelector('#nextButton');
|
||||
|
||||
if(preBtn)
|
||||
{
|
||||
$(preBtn).css('top', margin);
|
||||
}
|
||||
|
||||
if(nextBtn)
|
||||
{
|
||||
$(nextBtn).css('top', margin);
|
||||
}
|
||||
if(preBtn) $(preBtn).css('top', margin).css('left', offset);
|
||||
if(nextBtn) $(nextBtn).css('top', margin).css('right', offset);
|
||||
}
|
||||
|
||||
window.addEventListener('resize', function(event)
|
||||
{
|
||||
updateBtnPosition(event.target.innerHeight / 2);
|
||||
updateBtnPosition(event.target.innerHeight / 2, getOffset());
|
||||
});
|
||||
|
||||
window.getOffset = function()
|
||||
{
|
||||
let $mainContainer = $('#mainContainer');
|
||||
let offset = parseFloat($mainContainer.css('margin-left')) + parseFloat($mainContainer.css('padding-left'));
|
||||
return offset;
|
||||
}
|
||||
|
||||
$(() => {
|
||||
updateBtnPosition(window.innerHeight / 2);
|
||||
updateBtnPosition(window.innerHeight / 2, getOffset());
|
||||
});
|
||||
|
||||
@@ -30,7 +30,7 @@ class floatPreNextBtn extends wg
|
||||
(
|
||||
setID('preButton'),
|
||||
set::url($preLink),
|
||||
setClass('float-btn fixed left-0 z-10'),
|
||||
setClass('float-btn fixed z-10'),
|
||||
set::icon('angle-left'),
|
||||
set('data-app', $app->tab)
|
||||
) : null,
|
||||
@@ -38,7 +38,7 @@ class floatPreNextBtn extends wg
|
||||
(
|
||||
setID('nextButton'),
|
||||
set::url($nextLink),
|
||||
setClass('float-btn fixed right-0 z-10'),
|
||||
setClass('float-btn fixed z-10'),
|
||||
set::icon('angle-right'),
|
||||
set('data-app', $app->tab)
|
||||
) : null,
|
||||
|
||||
@@ -6,9 +6,9 @@ class globalSearch extends wg
|
||||
{
|
||||
protected static array $defineProps = array(
|
||||
'commonSearchText?: string',
|
||||
'commonSearchUrl: string',
|
||||
'searchItems: array',
|
||||
'searchFunc: callable'
|
||||
'commonSearchUrl?: string',
|
||||
'searchItems?: array',
|
||||
'searchFunc?: callable'
|
||||
);
|
||||
|
||||
public static function getPageJS(): string|false
|
||||
@@ -26,10 +26,7 @@ class globalSearch extends wg
|
||||
unset($lang->searchObjects['all']);
|
||||
|
||||
$searchItems = array();
|
||||
foreach($lang->searchObjects as $key => $module)
|
||||
{
|
||||
$searchItems[] = array('key' => $key, 'text' => $module);
|
||||
}
|
||||
foreach($lang->searchObjects as $key => $module) $searchItems[] = array('key' => $key, 'text' => $module);
|
||||
|
||||
$this->setDefaultProps(array(
|
||||
'commonSearchText' => $lang->searchAB,
|
||||
|
||||
Reference in New Issue
Block a user