Skip to content

Commit 8ea53dd

Browse files
committed
Move the auto-install setting to the offline page
Both offline settings now sit together above the offline docs table, instead of one on the preferences page and one on the offline page.
1 parent 2768b61 commit 8ea53dd

5 files changed

Lines changed: 16 additions & 12 deletions

File tree

‎assets/javascripts/templates/pages/offline_tmpl.js‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,18 @@ export const offlinePage = (docs, hasPersistence, isPersistent) => `\
1717
<h1 class="_lined-heading">Offline Documentation</h1>
1818
1919
<div class="_docs-tools">
20-
<label>
21-
<input type="checkbox" name="autoUpdate" value="1" ${
22-
app.settings.get("manualUpdate") ? "" : "checked"
23-
}>Install updates automatically
24-
</label>
20+
<div class="_docs-options">
21+
<label title="Only enable this when bandwidth isn't a concern to you.">
22+
<input type="checkbox" name="autoInstall" value="1" ${
23+
app.settings.get("autoInstall") ? "checked" : ""
24+
}>Automatically install enabled documentation for offline use
25+
</label>
26+
<label>
27+
<input type="checkbox" name="autoUpdate" value="1" ${
28+
app.settings.get("manualUpdate") ? "" : "checked"
29+
}>Automatically install updates of offline documentation
30+
</label>
31+
</div>
2532
<div class="_docs-links">
2633
<button type="button" class="_btn-link" data-action-all="install" title="Download every enabled documentation for offline use">Install all</button><button type="button" class="_btn-link" data-action-all="update" title="Download the current version of every outdated documentation"><strong>Update all</strong></button><button type="button" class="_btn-link" data-action-all="uninstall" title="Delete the offline data of every installed documentation">Uninstall all</button><button type="button" class="_btn-link _show" data-export-docs title="Save the installed documentations to a file, to restore them later or on another computer">Export all</button><label class="_btn-link _file-btn _show" title="Restore documentations from a previously exported file">Import<input type="file" name="importDocs" accept="application/json,.json"></label>
2734
</div>

‎assets/javascripts/templates/pages/settings_tmpl.js‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,6 @@ export const settingsPage = (settings) => `\
6767
settings.noAutofocus ? " checked" : ""
6868
}>Disable autofocus of search input
6969
</label>
70-
<label class="_settings-label">
71-
<input type="checkbox" form="settings" name="autoInstall" value="_auto-install"${
72-
settings.autoInstall ? " checked" : ""
73-
}>Automatically download documentation for offline use
74-
<small>Only enable this when bandwidth isn't a concern to you.</small>
75-
</label>
7670
<label class="_settings-label">
7771
<input type="checkbox" form="settings" name="autoLatestVersion" value="_auto-latest-version"${
7872
settings.autoLatestVersion ? " checked" : ""

‎assets/javascripts/views/content/offline_page.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ export class OfflinePage extends View {
191191
onChange(event) {
192192
if (event.target.name === "autoUpdate") {
193193
app.settings.set("manualUpdate", !event.target.checked);
194+
} else if (event.target.name === "autoInstall") {
195+
app.settings.set("autoInstall", event.target.checked);
194196
} else if (event.target.name === "importDocs") {
195197
this.importDocs(event.target);
196198
}

‎assets/javascripts/views/content/settings_page.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export class SettingsPage extends View {
3434
settings.smoothScroll = !app.settings.get("fastScroll");
3535
settings.arrowScroll = app.settings.get("arrowScroll");
3636
settings.noAutofocus = app.settings.get("noAutofocus");
37-
settings.autoInstall = app.settings.get("autoInstall");
3837
settings.autoLatestVersion = app.settings.get("autoLatestVersion");
3938
settings.analyticsConsent = app.settings.get("analyticsConsent");
4039
settings.spaceScroll = app.settings.get("spaceScroll");

‎assets/stylesheets/components/_content.scss‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,8 @@
283283
}
284284
}
285285

286+
._docs-options > label { display: block; }
287+
286288
._docs-links {
287289
-ms-flex: 0 0 auto;
288290
flex: 0 0 auto;

0 commit comments

Comments
 (0)