add a setting to always scroll selected entry to the top of the page, even if it fits entirely on screen (#1088)

This commit is contained in:
Athou
2023-06-24 09:48:36 +02:00
parent bb55a91a14
commit 7c226f41db
37 changed files with 219 additions and 31 deletions

View File

@@ -65,6 +65,8 @@ public class UserSettings extends AbstractModel {
@Column(name = "scroll_speed")
private int scrollSpeed;
private boolean alwaysScrollToEntry;
private boolean email;
private boolean gmail;
private boolean facebook;

View File

@@ -35,6 +35,9 @@ public class Settings implements Serializable {
@ApiModelProperty(value = "user's preferred scroll speed when navigating between entries", required = true)
private int scrollSpeed;
@ApiModelProperty(value = "always scroll selected entry to the top of the page, even if it fits entirely on screen", required = true)
private boolean alwaysScrollToEntry;
@ApiModelProperty(value = "sharing settings", required = true)
private SharingSettings sharingSettings = new SharingSettings();

View File

@@ -103,6 +103,7 @@ public class UserREST {
s.setCustomJs(settings.getCustomJs());
s.setLanguage(settings.getLanguage());
s.setScrollSpeed(settings.getScrollSpeed());
s.setAlwaysScrollToEntry(settings.isAlwaysScrollToEntry());
} else {
s.setReadingMode(ReadingMode.unread.name());
s.setReadingOrder(ReadingOrder.desc.name());
@@ -120,6 +121,7 @@ public class UserREST {
s.setScrollMarks(true);
s.setLanguage("en");
s.setScrollSpeed(400);
s.setAlwaysScrollToEntry(false);
}
return Response.ok(s).build();
}
@@ -145,6 +147,7 @@ public class UserREST {
s.setCustomJs(settings.getCustomJs());
s.setLanguage(settings.getLanguage());
s.setScrollSpeed(settings.getScrollSpeed());
s.setAlwaysScrollToEntry(settings.isAlwaysScrollToEntry());
s.setEmail(settings.getSharingSettings().isEmail());
s.setGmail(settings.getSharingSettings().isGmail());

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
<changeSet id="always-scroll-to-entry" author="athou">
<addColumn tableName="USERSETTINGS">
<column name="alwaysScrollToEntry" type="BOOLEAN" defaultValueBoolean="false">
<constraints nullable="false" />
</column>
</addColumn>
</changeSet>
</databaseChangeLog>

View File

@@ -20,5 +20,6 @@
<include file="changelogs/db.changelog-3.2.xml" />
<include file="changelogs/db.changelog-3.5.xml" />
<include file="changelogs/db.changelog-3.6.xml" />
<include file="changelogs/db.changelog-3.8.xml" />
</databaseChangeLog>