mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
User Settings General messages per page use <input number instead of select
This commit is contained in:
parent
023c8f603b
commit
081761b593
4 changed files with 7 additions and 17 deletions
|
|
@ -1,3 +1 @@
|
||||||
export const MESSAGES_PER_PAGE_VALUES = [10, 20, 30, 50, 100];
|
|
||||||
|
|
||||||
export const UNUSED_OPTION_VALUE = '__UNUSE__';
|
export const UNUSED_OPTION_VALUE = '__UNUSE__';
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
|
|
||||||
import { MESSAGES_PER_PAGE_VALUES } from 'Common/Consts';
|
|
||||||
import { SaveSettingsStep } from 'Common/Enums';
|
import { SaveSettingsStep } from 'Common/Enums';
|
||||||
import { EditorDefaultType, Layout } from 'Common/EnumsUser';
|
import { EditorDefaultType, Layout } from 'Common/EnumsUser';
|
||||||
import { Settings, SettingsGet } from 'Common/Globals';
|
import { Settings, SettingsGet } from 'Common/Globals';
|
||||||
|
|
@ -27,7 +26,6 @@ export class GeneralUserSettings {
|
||||||
this.languages = LanguageStore.languages;
|
this.languages = LanguageStore.languages;
|
||||||
this.messageReadDelay = SettingsUserStore.messageReadDelay;
|
this.messageReadDelay = SettingsUserStore.messageReadDelay;
|
||||||
this.messagesPerPage = SettingsUserStore.messagesPerPage;
|
this.messagesPerPage = SettingsUserStore.messagesPerPage;
|
||||||
this.messagesPerPageArray = MESSAGES_PER_PAGE_VALUES;
|
|
||||||
|
|
||||||
this.editorDefaultType = SettingsUserStore.editorDefaultType;
|
this.editorDefaultType = SettingsUserStore.editorDefaultType;
|
||||||
this.layout = SettingsUserStore.layout;
|
this.layout = SettingsUserStore.layout;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
|
|
||||||
import { MESSAGES_PER_PAGE_VALUES } from 'Common/Consts';
|
|
||||||
import { Layout, EditorDefaultType } from 'Common/EnumsUser';
|
import { Layout, EditorDefaultType } from 'Common/EnumsUser';
|
||||||
import { pInt, addObservablesTo } from 'Common/Utils';
|
import { pInt, addObservablesTo } from 'Common/Utils';
|
||||||
import { $htmlCL, SettingsGet } from 'Common/Globals';
|
import { $htmlCL, SettingsGet } from 'Common/Globals';
|
||||||
|
|
@ -21,10 +20,12 @@ export const SettingsUserStore = new class {
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
this.messagesPerPage = ko.observable(SettingsGet('MPP')).extend({ limitedList: MESSAGES_PER_PAGE_VALUES });
|
this.messagesPerPage = ko.observable(pInt(SettingsGet('MPP'))).extend(
|
||||||
|
{ rateLimit: { timeout: 999, method: "notifyWhenChangesStop" } }
|
||||||
|
);
|
||||||
|
|
||||||
this.messageReadDelay = ko.observable(pInt(SettingsGet('MessageReadDelay'))).extend(
|
this.messageReadDelay = ko.observable(pInt(SettingsGet('MessageReadDelay'))).extend(
|
||||||
{ rateLimit: { timeout: 500, method: "notifyWhenChangesStop" } }
|
{ rateLimit: { timeout: 999, method: "notifyWhenChangesStop" } }
|
||||||
);
|
);
|
||||||
|
|
||||||
addObservablesTo(this, {
|
addObservablesTo(this, {
|
||||||
|
|
|
||||||
|
|
@ -50,16 +50,9 @@
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label" data-i18n="SETTINGS_GENERAL/LABEL_MESSAGE_PER_PAGE"></label>
|
<label class="control-label" data-i18n="SETTINGS_GENERAL/LABEL_MESSAGE_PER_PAGE"></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<div data-bind="component: {
|
<input type="number" min="10" max="50" step="1" class="span1" data-bind="textInput: messagesPerPage"/>
|
||||||
name: 'Select',
|
|
||||||
params: {
|
<span data-bind="saveTrigger: mppTrigger"></span>
|
||||||
options: messagesPerPageArray,
|
|
||||||
value: messagesPerPage,
|
|
||||||
trigger: mppTrigger,
|
|
||||||
size: 2,
|
|
||||||
width: 80
|
|
||||||
}
|
|
||||||
}"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue