@pageboard/html 0.14.32 → 0.14.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/ui/form.js +3 -0
- package/ui/pagination.js +4 -5
package/package.json
CHANGED
package/ui/form.js
CHANGED
|
@@ -320,6 +320,9 @@ class HTMLElementForm extends Page.create(HTMLFormElement) {
|
|
|
320
320
|
for (const node of prelist) {
|
|
321
321
|
await node.presubmit(state);
|
|
322
322
|
}
|
|
323
|
+
form.enable();
|
|
324
|
+
scope.$request = form.read(true, e.submitter);
|
|
325
|
+
form.disable();
|
|
323
326
|
form.classList.add('loading');
|
|
324
327
|
scope.$response = await state.fetch(form.method, Page.format({
|
|
325
328
|
pathname: form.getAttribute('action'),
|
package/ui/pagination.js
CHANGED
|
@@ -14,13 +14,12 @@ class HTMLElementPagination extends Page.create(HTMLAnchorElement) {
|
|
|
14
14
|
console.warn("pagination does not find fetch node", this.dataset.fetch);
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
|
-
const name = node.dataset.
|
|
18
|
-
const
|
|
19
|
-
const stop = parseInt(node.dataset.stop) || 0;
|
|
17
|
+
const name = node.dataset.offsetName;
|
|
18
|
+
const offset = parseInt(node.dataset.offset) || 0;
|
|
20
19
|
const limit = parseInt(node.dataset.limit) || 10;
|
|
21
20
|
const count = parseInt(node.dataset.count) || 0;
|
|
22
21
|
const sign = this.dataset.dir == "-" ? -1 : +1;
|
|
23
|
-
const cur = sign > 0 ?
|
|
22
|
+
const cur = sign > 0 ? offset : (offset - 2 * limit);
|
|
24
23
|
|
|
25
24
|
this.setAttribute('href', Page.format({
|
|
26
25
|
pathname: state.pathname,
|
|
@@ -29,7 +28,7 @@ class HTMLElementPagination extends Page.create(HTMLAnchorElement) {
|
|
|
29
28
|
[name]: cur || undefined
|
|
30
29
|
}
|
|
31
30
|
}));
|
|
32
|
-
this.disabled = sign < 0 &&
|
|
31
|
+
this.disabled = sign < 0 && offset <= limit || sign > 0 && offset >= count;
|
|
33
32
|
}
|
|
34
33
|
handleClick(e) {
|
|
35
34
|
if (this.disabled) {
|