mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Replace knownEvents modules with static strings.
This commit is contained in:
@@ -2,10 +2,6 @@
|
||||
import observable = require("data/observable");
|
||||
import imageSource = require("image-source");
|
||||
|
||||
export module knownEvents {
|
||||
export var downloaded = "downloaded";
|
||||
}
|
||||
|
||||
export interface DownloadRequest {
|
||||
url: string;
|
||||
key: string;
|
||||
@@ -13,6 +9,8 @@ export interface DownloadRequest {
|
||||
}
|
||||
|
||||
export class Cache extends observable.Observable implements definition.Cache {
|
||||
public static downloadedEvent = "downloaded";
|
||||
|
||||
public placeholder: imageSource.ImageSource;
|
||||
public maxRequests = 5;
|
||||
private _enabled = true;
|
||||
@@ -135,9 +133,9 @@ export class Cache extends observable.Observable implements definition.Cache {
|
||||
request.completed(image, request.key);
|
||||
}
|
||||
|
||||
if (this.hasListeners(knownEvents.downloaded)) {
|
||||
if (this.hasListeners(Cache.downloadedEvent)) {
|
||||
this.notify({
|
||||
eventName: knownEvents.downloaded,
|
||||
eventName: Cache.downloadedEvent,
|
||||
object: this,
|
||||
key: key,
|
||||
image: image
|
||||
|
||||
Reference in New Issue
Block a user