admin: tab system improvement, search: ?search qp
tab content classes (e.g. settingsList, activityList) can implement "AsTab", "Navigatable" and or "PageEventBindable", the first giving them a tab name, a subpath and a reloader function, the second an "isURL" and "navigate" function for loading resources, the last giving them bind/unbindPageEvent methods. These are looped through in ts/admin.ts still crudely, maybe tabs.ts could accept "AsTab" implementers directly. "Search" class now has a ?search query param which just encodes the search box content, set when you perform a server search (hit enter or press the button). ?user queries from the accounts or activity tab will be converted to this form on loading.
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
import { PageManager, Page } from "../modules/pages.js";
|
||||
|
||||
export function isPageEventBindable(object: any): object is PageEventBindable {
|
||||
return "bindPageEvents" in object;
|
||||
}
|
||||
|
||||
export function isNavigatable(object: any): object is Navigatable {
|
||||
return "isURL" in object && "navigate" in object;
|
||||
}
|
||||
|
||||
export interface Tab {
|
||||
page: Page;
|
||||
tabEl: HTMLDivElement;
|
||||
|
||||
Reference in New Issue
Block a user