Created
November 17, 2011 19:43
-
-
Save radmiraal/1374229 to your computer and use it in GitHub Desktop.
Recursion issue with binding 2 textfields
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
imageWidthChange: function() { | |
var newHeight = Math.ceil(this.get('_imageSizeRatio') * this._imageWidth); | |
this.set('_imageHeight', newHeight); | |
}.observes('_imageWidth'), | |
imageHeightChange: function() { | |
var newWidth = Math.ceil(this.get('_imageSizeRatio') / this._imageHeight); | |
this.set('_imageWidth', newWidth); | |
}.observes('_imageHeight'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{view SC.TextField valueBinding="_imageWidth" }} | |
{{view SC.TextField valueBinding="_imageHeight" }} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment