added page titles

This commit is contained in:
Fran Jurmanović
2021-06-06 12:50:59 +02:00
parent a0122cc59a
commit 17551385a1
14 changed files with 78 additions and 20 deletions

View File

@@ -23,12 +23,6 @@ class AppFormElement extends BaseComponentElement {
this.update();
};
public keyUp = (e) => {
if (e.keyCode === 13) {
this.onSubmit(e);
}
};
public onSubmit = (e) => {
e.preventDefault();
if (!this.valid) {

View File

@@ -44,7 +44,10 @@ class AppLinkElement extends BaseComponentElement {
};
get disabled(): boolean {
return isTrue(this.goBack) && this.routerService.emptyState;
if (isTrue(this.goBack)) {
return this.routerService.emptyState;
}
return false;
}
render = (): TemplateResult => {
@@ -56,7 +59,7 @@ class AppLinkElement extends BaseComponentElement {
>${this.title}</a
>`
: html`<a
class="btn btn-link btn-disabled"
class="btn btn-link"
data-target="app-link.main"
data-action="click:app-link#goTo"
href="${this.to}"

View File

@@ -126,6 +126,11 @@ class AppMainElement extends HTMLElement {
this.dispatchEvent(this.domEvents.walletupdate);
};
public setTitle = (title: string): void => {
if (!title) title = __CONFIG__.appName;
window.document.title = title;
};
private createAppModal = () => {
const _appModal = document.createElement("app-modal");
_appModal.setAttribute("data-target", "app-main.appModal");

View File

@@ -120,7 +120,7 @@ class AppPaginationElement extends BaseComponentElement {
return html`
<div>
<button
class="btn btn-blue btn-squared ${page <= 1
class="btn btn-primary btn-squared ${page <= 1
? "disabled"
: ""}"
data-action="click:app-pagination#pageBack"
@@ -128,7 +128,8 @@ class AppPaginationElement extends BaseComponentElement {
Prev
</button>
<button
class="btn btn-blue btn-squared ${page >= pageRange
class="btn btn-primary btn-squared ${page >=
pageRange
? "disabled"
: ""}"
data-action="click:app-pagination#pageNext"

View File

@@ -105,7 +105,6 @@ class InputFieldElement extends BaseComponentElement {
data-target="input-field.inp"
data-action="
input:input-field#inputChange
keyup:app-form#keyUp
blur:input-field#validateDisplay
"
/>`;