title: how to close plugin dialog with tinymce 4.0b3
body: <p>I'd like to close the dialog within the onclick function of the first button, I've tried running the close() function that I've found on the windowManager object through console.log but it doesn't work.
  when I do:</p>
  
  <pre><code>console.log(editor.windowManager);
  </code></pre>
  
  <p>I see the following output: </p>
  
  <pre><code>Object {windows: Array[1], open: function, alert: function, confirm: function, close: function}
  </code></pre>
  
  <p>and then I call that close function you see in the output above like so</p>
  
  <pre><code>editor.windowManager.close();
  </code></pre>
  
  <p>and then I get: </p>
  
  <pre><code>Uncaught TypeError: Cannot call method 'close' of undefined
  </code></pre>
  
  <p>here is my code</p>
  
  <pre><code>            tinymce.PluginManager.add('jbimages', function (editor, url) {
                  function jbBox() {
                      editor.windowManager.open({
                          title: 'Upload an image',
                          file: url + '/dialog-v4.htm',
                          width: 350,
                          height: 135,
                          buttons: [{
                              text: 'Upload',
                              classes: 'widget btn primary first abs-layout-item',
                              disabled: false,
                              onclick: function(){
                                  $('#mce_39-body iframe').contents().find('#upl').submit();
                                  editor.windowManager.close();
                              }
                          }, {
                              text: 'Close',
                              onclick: 'close'
                          }]
                      })
                  }
    });
  </code></pre>