瀏覽代碼

addressing build failure

ssaket 6 年之前
父節點
當前提交
1e2238aedb
共有 3 個文件被更改,包括 15 次插入15 次删除
  1. 6 2
      gui/src/2D/advancedDynamicTexture.ts
  2. 6 6
      gui/src/2D/controls/inputText.ts
  3. 3 7
      src/Events/babylon.clipboardEvents.ts

+ 6 - 2
gui/src/2D/advancedDynamicTexture.ts

@@ -71,7 +71,11 @@ export class AdvancedDynamicTexture extends DynamicTexture {
     private _blockNextFocusCheck = false;
     private _renderScale = 1;
     private _rootCanvas: Nullable<HTMLCanvasElement>;
-    private _clipboardData: DataTransfer;
+    private _clipboardData: DataTransfer = new DataTransfer();
+
+    /**
+     * Observable event triggered each time an clipboard event is received from the rendering canvas
+     */
     public onClipboardObserver = new Observable<ClipboardInfo>();
 
     /**
@@ -396,7 +400,7 @@ export class AdvancedDynamicTexture extends DynamicTexture {
 
         this._rootContainer.dispose();
         this.onClipboardObserver.clear();
-        this.clipboardData.clearData();
+        this._clipboardData.clearData();
 
         super.dispose();
     }

+ 6 - 6
gui/src/2D/controls/inputText.ts

@@ -209,10 +209,10 @@ export class InputText extends Control implements IFocusableControl {
     }
 
     /** Gets or sets the highlight text */
-    public get getHighlightedText(): string {
+    public get highlightedText(): string {
         return this._highlightedText;
     }
-    public set setHighlightedText(text: string) {
+    public set highlightedText(text: string) {
         if (this._highlightedText === text) {
             return;
         }
@@ -489,8 +489,8 @@ export class InputText extends Control implements IFocusableControl {
     }
 
     /**
-     *  Callback in case of copy event, can be configured.
-     * @param {ClipboardEvent} ev
+     * Callback in case of copy event, can be configured.
+     * @param {ClipboardEvent} ev Defines the Clipboard event.
      */
     public onCopyText(ev: ClipboardEvent): void {
         this._isTextHighlightOn = false;
@@ -500,7 +500,7 @@ export class InputText extends Control implements IFocusableControl {
     }
     /**
      * Callback in case of cut event, can be configured.
-     * @param {ClipboardEvent} ev
+     * @param {ClipboardEvent} ev Defines the Clipboard event.
      */
     public onCutText(ev: ClipboardEvent): void {
         this.text = this._text.replace(this._highlightedText, "");
@@ -511,7 +511,7 @@ export class InputText extends Control implements IFocusableControl {
     }
     /**
      * Callback in case of paste event, can be configured.
-     *  @param {ClipboardEvent} ev
+     * @param {ClipboardEvent} ev Defines the Clipboard event.
      */
     public onPasteText(ev: ClipboardEvent): void {
         let data: string = "";

+ 3 - 7
src/Events/babylon.clipboardEvents.ts

@@ -50,24 +50,20 @@ module BABYLON {
          * @type {DataTransfer}
          */
         private _clipboardData: DataTransfer;
+
         /**
-         * Getter clipboardData
-         * @return {DataTransfer}
+         * Getter, setter for clipboardData
          */
         public get clipboardData(): DataTransfer {
             return this._clipboardData;
         }
-        /**
-         * Setter clipboardData
-         * @param {DataTransfer} value
-         */
         public set clipboardData(value: DataTransfer) {
             this._clipboardData = value;
         }
 
        /**
         *  Get the clipboard event's type from the keycode.
-        * @param keyCode
+        * @param keyCode Defines the keyCode for the current keyboard event.
         * @return {number}
         */
         public static GetTypeFromCharacter(keyCode: number): number {