title: How to detect multiple selections in elFinder
body: <p>I added a new toolbar button and an new context menu item to elFinder.</p>
  
  <p>Works nicely but this item should be enabled only if <em>one plain file</em> is selected. So should be dimmed when no file selected and should be dimmed when multiple files are selected or if is selected an directory.</p>
  
  <p>I learned than in the <code>elFinder.prototype.commands.mycmd</code> I should set the <code>this.getstate</code> return value to:</p>
  
  <ul>
  <li><code>0</code> if the toolbar/context-menu item should be enabled and</li>
  <li><code>-1</code> if it should be disabled</li>
  </ul>
  
  <p>So, now have this:</p>
  
  <p>el</p>
  
  <pre><code>Finder.prototype.commands.mycmd= function() {
  
      var self  = this,
          fm    = self.fm;
  
      self.disableOnSearch = true;
  
      self.title = 'mycmd';
  
      self.getstate = function() {
              // need help here to add the "directory is selected check"
          return fm.selected().length == 1 ? 0 : -1;
      }
  
      self.exec = function() {
          alert("hello");
      }
  }
  </code></pre>
  
  <p>Unfortunately, i know only Perl, so it is a bit hard for me digging thru all elFinder's javascript code to figure out how to master the condition.</p>
  
  <p>Know anybody <code>elFinder</code> enough deeply to help me with the condition?</p>