From: Joseph Spiros Date: Tue, 22 Mar 2011 18:52:49 +0000 (-0400) Subject: Made new windows position themselves randomly. X-Git-Url: http://git.ithinksw.org/philo.git/commitdiff_plain/4e1191300b4ebea295dee07769dc9da4e7149395?hp=-c Made new windows position themselves randomly. A better solution than this should be found, but for now this will avoid confusion when many windows of the same size are stacked. --- 4e1191300b4ebea295dee07769dc9da4e7149395 diff --git a/contrib/gilbert/media/gilbert/lib/app.js b/contrib/gilbert/media/gilbert/lib/app.js index d68e10c..f2f1aa4 100644 --- a/contrib/gilbert/media/gilbert/lib/app.js +++ b/contrib/gilbert/media/gilbert/lib/app.js @@ -292,6 +292,9 @@ Gilbert.lib.app.Application = Ext.extend(Ext.util.Observable, { 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 () {