Skip to content

Commit

Permalink
Add a more general callback method.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Aug 16, 2014
1 parent e052984 commit 3efd1e9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion horde/js/plupload/uploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,24 @@ var Horde_Uploader = Class.create({
this._puploader.start();
e.stop();
}.bindAsEventListener(this));
this.setReturnTarget(this._params['return_target']);
if (this._params['return_target']) {
this.setReturnTarget(this._params['return_target']);
}
$(this._params['return_button']).hide();
$(this._params['upload_button']).hide();
},

// @deprecated use setReturnAction instead
setReturnTarget: function(path)
{
$(this._params['return_button']).observe('click', function() { window.location = path });
},

setReturnCallback: function(js)
{
$(this._params['return_button']).observe('click', js.bindAsEventListener(this));
},

updateList: function()
{
$(this._params['return_button']).hide();
Expand Down

0 comments on commit 3efd1e9

Please sign in to comment.