Advertisement
Guest User

Untitled

a guest
Jan 25th, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. /**
  2. * Created by Don on 1/25/2015.
  3. */
  4. var wm = {
  5. _window_: {
  6. gui: require('nw.gui'),
  7. thisWindow: this.gui.Window.get()
  8. },
  9.  
  10. parentWindow: null,
  11.  
  12. open: function (location, option) {
  13. var newWindow, newWindowObject;
  14. newWindow = wm._window_.gui.Window.open(location, option);
  15.  
  16. newWindow.on('loaded', function () {
  17. newWindow.window.wm.parentWindow = wm._window_.thisWindow;
  18. newWindowObject = newWindow.window;
  19. });
  20.  
  21. return newWindowObject;
  22. },
  23.  
  24. cp: function (func) {
  25. func(wm.parentWindow);
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement