explorers' club

explorations in dev, science, sci-fi, games, and other fun stuff!


Leave a comment

Does Webstorm seem slow to regain focus when switching between applications? (Windows)

problem

I’ve been using the Webstorm IDE for all my JavaScript/HTML/CSS development.  Like any developer, I’m constantly alt-tabbing between Webstorm and the Browser as well as other applications.  After Webstorm has been open for a while, it takes a good 5-10 seconds to snap out of its coma and retake focus.  This is highly annoying and very unproductive.  Doing a search for any possible fix wasn’t producing the results I wanted.  Then I had the bright idea to search under IntelliJ & JetBrains (rather than WebStorm).  And a simple solution was found

solution

Simply open your preferences (File > Settings or ctrl+alt+s) then filter by ‘frame’.

src – https://devnet.jetbrains.com/docs/DOC-211


Leave a comment

CSS: Flex-style gap between sibling elements

I was needing to add a gap between sibling elements.  In Flex, this was done on the parent container by simply adding a gap style to it:

<s:VGroup gap="10">
   <ns:SomeElement/>
   <-- 10px vertical gap -->
   <ns:SomeElement/>
   <-- 10px vertical gap -->
   <ns:SomeElement/>
</s:VGroup>

In HTML/CSS we’re not afforded the gap style.  Instead we have to approach this by using the child elements and their margin styles.

<div>
   <div class="gap-elem"/>
   <div class="gap-elem"/>
   <div class="gap-elem"/>
</div>

<style>
.gap-elem:not(:first-child)
{
   margin-top: 10px;
}
</style>

I find this works with Angular’s ng-repeat directive nicely.  It might be worth writing a directive to simulate Flex’s application of the gap style.


Leave a comment

Notes on Angular 2014.06.10

I was trying to draw parallels in AngularJS and something like RobotLegs (which is my preferred MVC framework when building Flex/Flash applications).  Here are some interesting findings:

$scope.$root == $rootScope

There is no need to inject both $scope & $rootScope in a controller definition.  $scope is enough.

$scope.$emit

Angular has a built in event dispatching mechanism outside of the normal event dispatcher paradigm we see in JavaScript and ActionScript.  For those ActionScript developers, $emit is the equivalent of dispatching a bubbling event that bubbles up through the display list.  However in this case, Angular is bubbling up the $scope hierarchy.  This bubbles up towards the $rootScope

$scope.$broadcast

This is the opposite of bubbling up an event.  In this case, it’s drilling down descendent $scopes in the $scope hierarchy.

putting it all together

Follow

Get every new post delivered to your Inbox.