summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-14 12:25:41 +0300
committerAndrew Dolgov <[email protected]>2021-02-14 12:25:41 +0300
commit6b5c9c781b082c116538c313038f6d9c3ebdb757 (patch)
treee0c3026d721455a4a06899c78f8f07ebbbfd4776 /classes
parente5cedc7d5f0cb888342a48956c24f0246b7c3cde (diff)
pref prefs: load secondary tabs when needed
Diffstat (limited to 'classes')
-rw-r--r--classes/pref/prefs.php26
1 files changed, 22 insertions, 4 deletions
diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php
index ec7fbf607..19f5221eb 100644
--- a/classes/pref/prefs.php
+++ b/classes/pref/prefs.php
@@ -564,7 +564,7 @@ class Pref_Prefs extends Handler_Protected {
}
}
- private function index_auth() {
+ function index_auth() {
?>
<div dojoType='dijit.layout.TabContainer'>
<div dojoType='dijit.layout.ContentPane' title="<?= __('Personal data') ?>">
@@ -953,7 +953,7 @@ class Pref_Prefs extends Handler_Protected {
}
}
- private function index_plugins() {
+ function index_plugins() {
?>
<form dojoType="dijit.form.Form" id="changePluginsForm">
<script type="dojo/method" event="onSubmit" args="evt">
@@ -1028,13 +1028,31 @@ class Pref_Prefs extends Handler_Protected {
?>
<div dojoType='dijit.layout.AccordionContainer' region='center'>
<div dojoType='dijit.layout.AccordionPane' title="<i class='material-icons'>person</i> <?= __('Personal data / Authentication')?>">
- <?php $this->index_auth() ?>
+ <script type='dojo/method' event='onSelected' args='evt'>
+ if (this.domNode.querySelector('.loading'))
+ window.setTimeout(() => {
+ xhrPost("backend.php", {op: 'pref-prefs', method: 'index_auth'}, (transport) => {
+ console.log(this);
+ this.attr('content', transport.responseText);
+ });
+ }, 100);
+ </script>
+ <span class='loading'><?= __("Loading, please wait...") ?></span>
</div>
<div dojoType='dijit.layout.AccordionPane' selected='true' title="<i class='material-icons'>settings</i> <?= __('Preferences') ?>">
<?php $this->index_prefs() ?>
</div>
<div dojoType='dijit.layout.AccordionPane' title="<i class='material-icons'>extension</i> <?= __('Plugins') ?>">
- <?php $this->index_plugins() ?>
+ <script type='dojo/method' event='onSelected' args='evt'>
+ if (this.domNode.querySelector('.loading'))
+ window.setTimeout(() => {
+ xhrPost("backend.php", {op: 'pref-prefs', method: 'index_plugins'}, (transport) => {
+ console.log(this);
+ this.attr('content', transport.responseText);
+ });
+ }, 200);
+ </script>
+ <span class='loading'><?= __("Loading, please wait...") ?></span>
</div>
<?php PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB, "prefPrefs") ?>
</div>