180 karma · joined February 25, 2011
Feature request: When a component pane(code snippet + preview) is open, allow escape key to close the pane.
Is this code open source? Would be happy to submit a PR for this feature if it is.
If you like this kind of stuff, check out Colin Furze's youtube channel. He does some similar experiments, and is very entertaining.
Is it possible to control the size (width and height) of the chrome debugger panel using the devtools api? I want to build a chrome extension that provides window management like Hydra or spectacle, but for the developer tools window. Building hot keys that could do things like send the console window exactly half screen in any direction or full screen, and also the same controls for the second console window. I spend a lot of time in the developer panel (as I'm sure many people do) and think a window manager could be a huge help. I read the api docs fairly thoroughly and also posted this same question to the google group and the stack overflow group with no response to either. Anyone out there know?
letsdrive = myRide.drive window.model = 'mercedes'; letsdrive.model = 'bmw';
letsdrive(); // outputs mercedes
Javascript context is pretty simple. The keyword 'this' by default points at the object that the method belongs to. When you invoke this function :
myRide.drive();
the myride object owns the drive function, so any keyword 'this' inside of the drive function will be referring to the myride object.
when you do this:
letsDrive = myRide.drive;
letsdrive is now a function that belongs to the global object (window) since we did not declare an object for it. So 'this' is reffering to the window object.To get the output in your example, you would say
window.model = 'Mercedes';
And invoking letsdrive() will now return the expected result