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’.

note

Note that if you change your project’s files from outside Webstorm, you may need to manually synchronize Webstorm’s copy.  To do this, right-click on the folder in your project’s file structure and click synchronize. This only seems to occur on Windows machines due to how they access files (via some locking mechanism?).

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.

Follow

Get every new post delivered to your Inbox.