diff options
author | Tobi Oetiker <tobi@oetiker.ch> | 2007-11-17 04:13:07 +0100 |
---|---|---|
committer | Tobi Oetiker <tobi@oetiker.ch> | 2007-11-17 04:13:07 +0100 |
commit | 6d0c470a6bbc643438243d1aecd0415a0b793373 (patch) | |
tree | ff07e304b170870776e82ae240285ba6676b8af4 /qooxdoo/source/class/Smokeping/ui | |
parent | c8daf4f31084534e58dd90ccdfa88ba2285ec324 (diff) | |
download | smokeping-6d0c470a6bbc643438243d1aecd0415a0b793373.tar.gz smokeping-6d0c470a6bbc643438243d1aecd0415a0b793373.tar.xz |
added windows
Diffstat (limited to 'qooxdoo/source/class/Smokeping/ui')
-rw-r--r-- | qooxdoo/source/class/Smokeping/ui/Graphs.js | 30 | ||||
-rw-r--r-- | qooxdoo/source/class/Smokeping/ui/TargetTree.js | 2 |
2 files changed, 22 insertions, 10 deletions
diff --git a/qooxdoo/source/class/Smokeping/ui/Graphs.js b/qooxdoo/source/class/Smokeping/ui/Graphs.js index 7a9fb83..8a2502a 100644 --- a/qooxdoo/source/class/Smokeping/ui/Graphs.js +++ b/qooxdoo/source/class/Smokeping/ui/Graphs.js @@ -34,23 +34,35 @@ qx.Class.define('Smokeping.ui.Graphs', setHorizontalSpacing(10); setPadding(10); }; - var load_graphs = function(m){ var files = m.getData() this.removeAll(); for(var i=0;i<files.length;i++){ - this.debug('adding '+files[i]) var button = new qx.ui.form.Button(null,qx.io.Alias.getInstance().resolve('SP/image/ajax-loader.gif')); this.add(button); - var image = button.getIconObject(); + button.addEventListener('execute',function(e){ + this.setEnabled(false); + var window = this.getUserData('window'); + window.positionRelativeTo(this.getElement(),2,-4); + window.open(); + },button); + var preloader = qx.io.image.PreloaderManager.getInstance().create(url + 'grapher.cgi?g=' + files[i]); - preloader.setUserData('image',image); // it seems javascript does not do closures - preloader.addEventListener('load', function(e) { - var image = this.getUserData('image'); /// so we use this to whisk the image into the event - // image.setWidth(preloader.getWidth()-10); - this.debug('load image event: '+preloader.getSource()); - image.setPreloader(this); + preloader.setUserData('button',button); // it seems javascript does not do closures + preloader.addEventListener('load', function(e) { + var button = this.getUserData('button'); /// so we use this to whisk the image into the event + var image = button.getIconObject(); + image.setSource(this.getSource()); qx.io.image.PreloaderManager.getInstance().remove(this); + + var window = new Smokeping.ui.Navigator(image); + window.addToDocument(); + window.addEventListener('beforeDisappear',function (e){ + this.setEnabled(true); + },button); + button.setUserData('window',window); + + // image.setWidth(preloader.getWidth()-10); //if (image.isLoaded()) { // this.debug('outer '+image.getOuterHeight()); // this.debug('inner '+image.getInnerHeight()); diff --git a/qooxdoo/source/class/Smokeping/ui/TargetTree.js b/qooxdoo/source/class/Smokeping/ui/TargetTree.js index d335361..c5624a2 100644 --- a/qooxdoo/source/class/Smokeping/ui/TargetTree.js +++ b/qooxdoo/source/class/Smokeping/ui/TargetTree.js @@ -99,7 +99,7 @@ qx.Class.define('Smokeping.ui.TargetTree', } else { i++; // skip the node id for now var file = new qx.ui.tree.TreeFile(data[i]); - files[files.length] = data[i-1]; + files.push(data[i-1]); folder.add(file); } } |