dcneiner/Downloadify — Issue #19: Add onClick event
Author: dugokontov
Created: 2012-02-28 09:18:12+00:00
State: open

When a large file is to be generated it takes some 4-5 seconds to do so. Since no change on web UI is made, user may think that he didn't click the icon, and try to click it again. To prevent this, I would like to suggest you to add one more event, *onClick* that will be fired before *getTextForSave*.

I think changes should be done in those two files:
**Downloadify.as**
add on line 144:
```ExternalInterface.call('Downloadify.callOnClick',queue_name),```

**downloadify.js**
add on line 32
```
callOnClick: function(queue){
var obj = Downloadify.queue[queue];
if(obj) obj.click();
},
```
add on line 176
```
base.click= function(){
if( typeof(base.options.onClick) === "function" ) base.options.onClick();
};
```

Also, note that I have tried to make UI changes in *data* event, but for some reason they are not shown until data generation has been done.