How do I open the class browser with a specific class?

126 Views Asked by At

Amber Smalltalk version 0.13

In this project I'd like to open the class browser with a specific class.

  <button onClick="amber.globals.Browser._openOn_(amber.globals.ProcessingClock)">ProcessingClock class

I get the error message amber not defined (see screen shot below).

Question How do I open the browser properly?

enter image description here

1

There are 1 best solutions below

2
AudioBubble On

Of course it is not defined, amber is just a local variable (that is, a parameter) of the loader callback function. Either remember it to some global and reuse in button onclick code (ugly), install onclick handler on the button directly inside loader callback, where you have access to amber variable (probably clumsy, but the most clean), or use require('amber/helpers') instead of amber in direct onclick handlers (in your example you want need to use it twice).