</button>
</div>
<div class="modal-body">
+ <p i18n>Assignments toward the top have higher precedence</p>
<div class="row border-bottom">
<div class="col-3 p-1 border-right text-center" i18n>Command</div>
<div class="col-9 p-1" i18n>Action</div>
/**
- * Assign access keys from within templates via <a> tags.
- * Both href and routerLink attributes are supported.
+ * Assign access keys to <a> tags.
+ *
+ * Access key action is peformed via .click(). hrefs, routerLinks,
+ * and (click) actions are all supported.
*
* <a
* routerLink="/staff/splash"
if (keySpec == this.assignments[i].key) {
let assign = this.assignments[i];
console.debug(`EgAccessKey assignment found for ${assign.key}`);
- assign.action();
+ // Allow the current digest cycle to complete before
+ // firing the access key action.
+ setTimeout(assign.action, 0);
evt.preventDefault();
return;
}
open(): Promise<any> {
if (this.modalRef !== null) {
- //This can happen when a dialog is dismissed by clicking
- //outside of the modal. Avoid treating it like an error.
- //console.debug('Dismissing existing dialog!');
+ console.warn('Dismissing existing dialog');
this.dismiss();
}
this.modalRef = this.modalService.open(this.dialogContent);
- return this.modalRef.result;
+ return new Promise( (resolve, reject) => {
+
+ this.modalRef.result.then(
+ (result) => {
+ resolve(result);
+ this.modalRef = null;
+ },
+ (result) => {
+ reject(result);
+ this.modalRef = null;
+ }
+ );
+ });
}
close(reason?: any): void {
this.modalRef.close(reason);
- this.modalRef = null;
}
dismiss(reason?: any): void {
this.modalRef.dismiss(reason);
- this.modalRef = null;
}
}
this.newName = this.newOwner.shortname() + '-' + this.newName;
this.registerWorkstationApi().then(
- wsId => this.registerWorkstationLocal(wsId));
-
+ wsId => this.registerWorkstationLocal(wsId),
+ notOk => console.log('Workstation registration canceled/failed')
+ );
}
private handleCollision(): Promise<number> {
<div class="nav-item">
<a i18n class="nav-link with-material-icon"
routerLink="/staff/splash"
- egAccessKey keySpec="alt+h" keyDesc="My Description"
- i18n-keySpec i18n-keyDesc>
-
+ egAccessKey
+ keySpec="alt+h" i18n-keySpec
+ keyDesc="Navigate Home" i18n-keyDesc>
<span class="material-icons">home</span>
</a>
</div>
<span class="material-icons">assignment</span>
<span i18n>Search for Copies by Barcode</span>
</a>
- <a class="dropdown-item" routerLink="/staff/catalog/search">
+ <a class="dropdown-item" routerLink="/staff/catalog/search"
+ egAccessKey
+ keySpec="alt+c" i18n-keySpec
+ keyDesc="Navigate To Catalog" i18n-keyDesc>
<span class="material-icons">search</span>
<span i18n>Search the Catalog</span>
</a>
<eg-accesskey-info #egAccessKeyInfo></eg-accesskey-info>
<a egAccessKey
keySpec="ctrl+h" i18n-keySpec
- keyDesc="Show Info Dialog" i18n-keyDesc
+ keyDesc="Display Access Key Info Dialog" i18n-keyDesc
(click)="egAccessKeyInfo.open()">
</a>