diff options
author | Sunil Shetye | 2018-08-29 10:48:12 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-08-29 18:03:04 +0530 |
commit | 352623792d2b9400510599c487540b1e763a7d3c (patch) | |
tree | 7711522f3fcd42a9d5f22b9fa3328763452a6918 /js/Misc/BOUNCE.js | |
parent | 17a1beeeae647a6fbd0904a5d794ce7754df7eb2 (diff) | |
download | sci2js-352623792d2b9400510599c487540b1e763a7d3c.tar.gz sci2js-352623792d2b9400510599c487540b1e763a7d3c.tar.bz2 sci2js-352623792d2b9400510599c487540b1e763a7d3c.zip |
add the common code to get method also
type is a function
get the popup title from the value set in the get method
Diffstat (limited to 'js/Misc/BOUNCE.js')
-rw-r--r-- | js/Misc/BOUNCE.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/js/Misc/BOUNCE.js b/js/Misc/BOUNCE.js index f9680e27..b9ff94bb 100644 --- a/js/Misc/BOUNCE.js +++ b/js/Misc/BOUNCE.js @@ -42,6 +42,12 @@ function BOUNCE() { return this.x; } BOUNCE.prototype.get = function BOUNCE() { + var exprs = this.graphics.exprs; + if (size(exprs,"*")<9) { + exprs[8-1] = "9.81"; + exprs[9-1] = "0"; + } + this.set_param_popup_title = "Set Bounce Block"; var options = { rpar1:["Mass",this.rpar1], rpar2:["Radius",this.rpar2], @@ -132,7 +138,6 @@ function BOUNCE() { return new BasicBlock(this.x); } BOUNCE.prototype.get_popup_title = function BOUNCE() { - var set_param_popup_title = "Set Bounce Block"; - return set_param_popup_title; + return this.set_param_popup_title; } } |