PDA

View Full Version : Web Desktop Sample Question



ridiculous
3 Dec 2009, 8:51 PM
/examples/desktop/desktop.html

What does the function look like that is bound to each desktop icon's "click" event?
I want to bind this function to other events (i.e. so that I might open a window using an event other than an icon click).

Also, is there a way to easily answer this question using Firebug? If so, how?

husniadil
3 Dec 2009, 11:55 PM
go to /examples/desktop/js/Desktop.js

look at the end of file.. you will find code like this:



if(shortcuts){
shortcuts.on('click', function(e, t){
if(t = e.getTarget('dt', shortcuts)){
e.stopEvent();
var module = app.getModule(t.id.replace('-shortcut', ''));
if(module){
module.createWindow();
}
}
});
}