@paperbits/core
Advanced tools
Comparing version 0.1.62 to 0.1.63
{ | ||
"name": "@paperbits/core", | ||
"version": "0.1.62", | ||
"version": "0.1.63", | ||
"description": "Paperbits core components.", | ||
@@ -23,4 +23,4 @@ "author": "Paperbits", | ||
"dependencies": { | ||
"@paperbits/common": "0.1.62", | ||
"@paperbits/styles": "0.1.62", | ||
"@paperbits/common": "0.1.63", | ||
"@paperbits/styles": "0.1.63", | ||
"cropperjs": "^1.4.0", | ||
@@ -27,0 +27,0 @@ "file-saver": "^2.0.0", |
@@ -17,3 +17,3 @@ import * as ko from "knockout"; | ||
export class LayoutsWorkshop { | ||
private template: Contract; | ||
private searchTimeout: any; | ||
@@ -45,4 +45,10 @@ public readonly searchPattern: ko.Observable<string>; | ||
@OnMounted() | ||
public async searchLayouts(searchPattern: string = ""): Promise<void> { | ||
public async initialize(): Promise<void> { | ||
this.searchPattern.subscribe(this.searchLayouts); | ||
this.searchLayouts(); | ||
} | ||
public async launchSearch(searchPattern: string = ""): Promise<void> { | ||
this.working(true); | ||
this.layouts([]); | ||
@@ -56,2 +62,7 @@ const layouts = await this.layoutService.search(searchPattern); | ||
public async searchLayouts(searchPattern: string = ""): Promise<void> { | ||
clearTimeout(this.searchTimeout); | ||
this.searchTimeout = setTimeout(() => this.launchSearch(searchPattern), 600); | ||
} | ||
public selectLayout(layoutItem: LayoutItem): void { | ||
@@ -58,0 +69,0 @@ this.selectedLayout(layoutItem); |
@@ -7,5 +7,4 @@ import * as ko from "knockout"; | ||
import { Keys } from "@paperbits/common/keyboard"; | ||
import { Component } from "@paperbits/common/ko/decorators"; | ||
import { Component, OnMounted } from "@paperbits/common/ko/decorators"; | ||
import { PageItem } from "./pageItem"; | ||
import { LayoutViewModelBinder } from "../../../layout/ko"; | ||
@@ -31,15 +30,11 @@ | ||
) { | ||
// rebinding... | ||
this.searchPages = this.searchPages.bind(this); | ||
this.addPage = this.addPage.bind(this); | ||
this.selectPage = this.selectPage.bind(this); | ||
this.onKeyDown = this.onKeyDown.bind(this); | ||
// setting up... | ||
this.pages = ko.observableArray<PageItem>(); | ||
this.selectedPage = ko.observable<PageItem>(); | ||
this.searchPattern = ko.observable<string>(""); | ||
this.searchPattern.subscribe(this.searchPages); | ||
this.working = ko.observable(true); | ||
} | ||
@OnMounted() | ||
public async initialize(): Promise<void> { | ||
this.searchPattern.subscribe(this.searchPages); | ||
this.searchPages(); | ||
@@ -49,2 +44,5 @@ } | ||
private async launchSearch(searchPattern: string = ""): Promise<void> { | ||
this.working(true); | ||
this.pages([]); | ||
const pages = await this.pageService.search(searchPattern); | ||
@@ -54,13 +52,8 @@ const pageItems = pages.map(page => new PageItem(page)); | ||
this.pages(pageItems); | ||
this.working(false); | ||
} | ||
public async searchPages(searchPattern: string = ""): Promise<void> { | ||
this.working(true); | ||
this.pages([]); | ||
clearTimeout(this.searchTimeout); | ||
this.searchTimeout = setTimeout(async () => { | ||
await this.launchSearch(searchPattern); | ||
this.working(false); | ||
}, 600); | ||
this.searchTimeout = setTimeout(() => this.launchSearch(searchPattern), 600); | ||
} | ||
@@ -70,3 +63,3 @@ | ||
this.selectedPage(pageItem); | ||
this.viewManager.openViewAsWorkshop("Page", "page-details-workshop", { | ||
@@ -110,4 +103,2 @@ pageItem: pageItem, | ||
} | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
640086
11932
+ Added@paperbits/common@0.1.63(transitive)
+ Added@paperbits/styles@0.1.63(transitive)
- Removed@paperbits/common@0.1.62(transitive)
- Removed@paperbits/styles@0.1.62(transitive)
Updated@paperbits/common@0.1.63
Updated@paperbits/styles@0.1.63