Open OttoVanzig opened 7 years ago
hello again, well I've been able to solve "half" on the problem. What I did : In the .js file a init() (outside the document.ready function) as below ` $('.tool-container').remove(); //remove all
$('div[data-toolbar="file-ctrt-options"]').toolbar({
content: '#toolbar-options',
event: 'click',
hideOnClick: true,
}); //attach the toolbars
//handle click event
$(' .btn-toolbar').on('click', function(event) {
//handle item click event
$('div[data-toolbar="file-ctrt-options"]').on('toolbarItemClick', function(event, buttonClicked) {`
in the php file
<div id="toolbar-options" class="hidden">//the buttons</div>
And now to launch everything
in the .js file inside the document.ready function
init()
this works fine. All the different toolbars are working
When a file is oploaded :
ajax (done: load (files div) setTimeout(function() { //delete and recreate JS toolbar initJSToolbar(); }, 300);
this works ok for the files inside the reloaded div.
The only issue is that after this the others files on the page lost their toolbar !
they are effectively recreated but when you click on a file they are not fired, but they exists and it looks like they are linked to the right file.
Many thanks if somebody could have a advice !
hi there, I'm using multiple js toolbar on files icon and it works fine. I wonder how to attach the toolbar to a new file icon after an ajax upload. I tried to put an init() function with the toolbars remove (to suppress the old ones) and creation and call the init() in the upload/done event. It looks like the new tool-containers are created but they are not displayed on click. any idea thanks in advance