Made new windows position themselves randomly.
authorJoseph Spiros <joseph.spiros@ithinksw.com>
Tue, 22 Mar 2011 18:52:49 +0000 (14:52 -0400)
committerJoseph Spiros <joseph.spiros@ithinksw.com>
Tue, 22 Mar 2011 18:52:49 +0000 (14:52 -0400)
A better solution than this should be found, but for now this will avoid confusion when many windows of the same size are stacked.

contrib/gilbert/media/gilbert/lib/app.js

index d68e10c..f2f1aa4 100644 (file)
@@ -292,6 +292,9 @@ Gilbert.lib.app.Application = Ext.extend(Ext.util.Observable, {
                        minimizable: true,
                        constrainHeader: true,
                }));
                        minimizable: true,
                        constrainHeader: true,
                }));
+               
+               win.setPosition(Math.floor(Math.random() * ((this.desktop.getInnerWidth() - win.width) - 1)), Math.floor(Math.random() * ((this.desktop.getInnerHeight() - win.height) - 1)));
+               
                win.render(this.desktop.el);
                if (win.modal) {
                        win.on('show', function () {
                win.render(this.desktop.el);
                if (win.modal) {
                        win.on('show', function () {