Allow to override #app-content and #app-navigation hrefs for content skipping

Signed-off-by: Julius Härtl <jus@bitgrid.net>
pull/33247/head
Julius Härtl 2022-07-16 09:58:33 +07:00
parent 16b06dd758
commit ca0435382d
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
3 changed files with 9 additions and 3 deletions

@ -133,7 +133,10 @@ class DashboardController extends Controller {
$this->inititalState->provideInitialState('version', $this->config->getUserValue($this->userId, 'dashboard', 'backgroundVersion', 0)); $this->inititalState->provideInitialState('version', $this->config->getUserValue($this->userId, 'dashboard', 'backgroundVersion', 0));
$this->config->setUserValue($this->userId, 'dashboard', 'firstRun', '0'); $this->config->setUserValue($this->userId, 'dashboard', 'firstRun', '0');
$response = new TemplateResponse('dashboard', 'index'); $response = new TemplateResponse('dashboard', 'index', [
'id-app-content' => '#app-dashboard',
'id-app-navigation' => null,
]);
// For the weather widget we should allow the geolocation // For the weather widget we should allow the geolocation
$featurePolicy = new Http\FeaturePolicy(); $featurePolicy = new Http\FeaturePolicy();

@ -49,8 +49,8 @@ $getUserAvatar = static function (int $size) use ($_): string {
<input type="hidden" id="initial-state-<?php p($app); ?>" value="<?php p(base64_encode($initialState)); ?>"> <input type="hidden" id="initial-state-<?php p($app); ?>" value="<?php p(base64_encode($initialState)); ?>">
<?php }?> <?php }?>
<a href="#app-content" class="button primary skip-navigation skip-content"><?php p($l->t('Skip to main content')); ?></a> <?php if ($_['id-app-content'] !== null) { ?><a href="<?php p($_['id-app-content']); ?>" class="button primary skip-navigation skip-content"><?php p($l->t('Skip to main content')); ?></a><?php } ?>
<a href="#app-navigation" class="button primary skip-navigation"><?php p($l->t('Skip to navigation of app')); ?></a> <?php if ($_['id-app-navigation'] !== null) { ?><a href="<?php p($_['id-app-navigation']); ?>" class="button primary skip-navigation"><?php p($l->t('Skip to navigation of app')); ?></a><?php } ?>
<div id="notification-container"> <div id="notification-container">
<div id="notification"></div> <div id="notification"></div>

@ -281,6 +281,9 @@ class TemplateLayout extends \OC_Template {
} }
$this->assign('initialStates', $this->initialState->getInitialStates()); $this->assign('initialStates', $this->initialState->getInitialStates());
$this->assign('id-app-content', '#app-content');
$this->assign('id-app-navigation', '#app-navigation');
} }
/** /**