views:

462

answers:

2

Hi, I'm using the Jquery's simple photo manager just as it is and it's working properly.

http://jqueryui.com/demos/droppable/photo-manager.html

All I need is the possibility to recycle all the elements from the trash by a single click. Sounds simple but I couldn't get it so far. Ok, I'm a newbie to Jquery.

Help would be appreciated!

A: 

$('#trash .ui-icon-refresh').trigger('click');

In your setup at http://romtec-online.com/photo-manager.html, you could write the following line to enable the 'Recycle all' button:

$('.ui-icon-recycle-all').click(function() {
    $('#trash .ui-icon-refresh').trigger('click');
});
Alexander Gyoshev
Thank you, but I'm still not sure how to implement this. Either nothing happens or I receive a "too much recursion" error.
Roman
I tried it on the jQuery UI demo through the Firebug console - do you have a link to your setup?
Alexander Gyoshev
A: 

There is no real setup, but you can see what I did under the following address:

http://romtec-online.com/photo-manager.html

Sorry, lost my login somehow...

You've added the function to the recycle link on the items - if you want to enable it for the "recycle all" button, see my updated answer. And just a side-note, it is better to add this information to your question rather than posting it as an answer...
Alexander Gyoshev
Perfect! it's working, thank you very much!(as I mentioned before I lost my login somehow, so I have to post it this way, sorry).