From fd54dabad7cbc27a0efb0957155c00d578912909 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 16 May 2012 15:32:36 -0700 Subject: changing @change to propertyChangeListener Signed-off-by: Valerio Virgillito --- js/helper-classes/3D/snap-manager.js | 8 ++++---- js/io/ui/file-picker/file-input-field.reel/file-input-field.js | 2 +- .../new-file-dialog/new-file-location.reel/new-file-location.js | 2 +- js/io/ui/save-as-dialog.reel/save-as-dialog.js | 2 +- js/mediators/keyboard-mediator.js | 2 +- js/ninja.reel/ninja.js | 6 +++--- js/stage/stage.reel/stage.js | 9 ++++----- 7 files changed, 15 insertions(+), 16 deletions(-) (limited to 'js') diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js index 5a36e367..2e8020d3 100755 --- a/js/helper-classes/3D/snap-manager.js +++ b/js/helper-classes/3D/snap-manager.js @@ -130,10 +130,10 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { bindSnap: { value: function() { - this.addEventListener("change@appModel.snap", this.toggleSnap, false); - this.addEventListener("change@appModel.snapGrid", this.toggleSnapGrid, false); - this.addEventListener("change@appModel.snapObjects", this.toggleSnapObjects, false); - this.addEventListener("change@appModel.snapAlign", this.toggleSnapAlign, false); + this.addPropertyChangeListener("appModel.snap", this.toggleSnap, false); + this.addPropertyChangeListener("appModel.snapGrid", this.toggleSnapGrid, false); + this.addPropertyChangeListener("appModel.snapObjects", this.toggleSnapObjects, false); + this.addPropertyChangeListener("appModel.snapAlign", this.toggleSnapAlign, false); } }, diff --git a/js/io/ui/file-picker/file-input-field.reel/file-input-field.js b/js/io/ui/file-picker/file-input-field.reel/file-input-field.js index 9e77759f..a5fab11c 100755 --- a/js/io/ui/file-picker/file-input-field.reel/file-input-field.js +++ b/js/io/ui/file-picker/file-input-field.reel/file-input-field.js @@ -16,7 +16,7 @@ var FileInputField = exports.FileInputField = Montage.create(Component, { this.findDirectory.identifier = "findDirectory"; this.findDirectory.addEventListener("click", this, false); this.eventManager.addEventListener("pickerSelectionsDone", this.handleFileInputPickerSelectionsDone, false); - this.addEventListener("change@newFileDirectory.value", this.handleNewFileDirectoryChange, false); + this.addPropertyChangeListener("newFileDirectory.value", this.handleNewFileDirectoryChange, false); this.newFileDirectory.element.addEventListener("keyup", this, false); } }, diff --git a/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js index 3ac38d02..e8a699cc 100755 --- a/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js +++ b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js @@ -22,7 +22,7 @@ var NewFileLocation = exports.NewFileLocation = Montage.create(Component, { value: function() { this.fileInputField.selectDirectory = true; - this.addEventListener("change@newFileName.value", this.newFileNameChange, false); + this.addPropertyChangeListener("newFileName.value", this.newFileNameChange, false); this.newFileName.element.addEventListener("keyup", this, false); this.newFileName.element.focus(); this.newFileName.element.select(); diff --git a/js/io/ui/save-as-dialog.reel/save-as-dialog.js b/js/io/ui/save-as-dialog.reel/save-as-dialog.js index e2f50ff5..a27d9d13 100644 --- a/js/io/ui/save-as-dialog.reel/save-as-dialog.js +++ b/js/io/ui/save-as-dialog.reel/save-as-dialog.js @@ -57,7 +57,7 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { this.fileInputField.selectDirectory = true; this.fileInputField.pickerName = "saveAsDirectoryPicker"; - this.addEventListener("change@newFileName.value", this.handleNewFileNameChange, false); + this.addPropertyChangeListener("newFileName.value", this.handleNewFileNameChange, false); this.newFileName.element.addEventListener("keyup", this, false); this.eventManager.addEventListener("newFileDirectorySet", function(evt){self.handleNewFileDirectorySet(evt);}, false); this.okButton.addEventListener("click", function(evt){self.handleOkButtonAction(evt);}, false); diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index 49960f58..243caf5c 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js @@ -67,7 +67,7 @@ exports.KeyboardMediator = Montage.create(Component, { document.addEventListener("keydown", this, false); document.addEventListener("keyup", this, false); - this.addEventListener("change@appModel.livePreview", this.handleLivePreview, false); + this.addPropertyChangeListener("appModel.livePreview", this.handleLivePreview, false); } }, diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 3fcce925..87167d4c 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -165,9 +165,9 @@ exports.Ninja = Montage.create(Component, { this.eventManager.addEventListener( "selectSubTool", this, false); this.eventManager.addEventListener( "onOpenDocument", this, false); - this.addEventListener("change@appModel.livePreview", this.executeLivePreview, false); - this.addEventListener("change@appModel.chromePreview", this.executeChromePreview, false); - this.addEventListener("change@appModel.debug", this.toggleDebug, false); + this.addPropertyChangeListener("appModel.livePreview", this.executeLivePreview, false); + this.addPropertyChangeListener("appModel.chromePreview", this.executeChromePreview, false); + this.addPropertyChangeListener("appModel.debug", this.toggleDebug, false); NJevent("appLoading"); } diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index 125155d8..93270561 100755 --- a/js/stage/stage.reel/stage.js +++ b/js/stage/stage.reel/stage.js @@ -300,7 +300,7 @@ exports.Stage = Montage.create(Component, { // TODO - We will need to modify this once we support switching between multiple documents this.application.ninja.toolsData.selectedToolInstance._configure(true); - this.addEventListener("change@appModel.show3dGrid", this, false); + this.addPropertyChangeListener("appModel.show3dGrid", this, false); this.layout.handleOpenDocument(); } @@ -309,10 +309,9 @@ exports.Stage = Montage.create(Component, { /** * Event handler for the change @ 3DGrid */ - handleEvent: { - value: function(e) { - if(e.type === "change@appModel.show3dGrid") { - + handleChange: { + value: function(notification) { + if("appModel.show3dGrid" === notification.currentPropertyPath) { if(this.appModel.show3dGrid) { drawUtils.drawXY = true; -- cgit v1.2.3