# HG changeset patch # User Franck Deroche # Date 1253279566 -7200 # Node ID 7ed2ac0cec276f06be9b71504d54e9666141255d # Parent abc9d39cfbe9f0563a1b1db4e46c1b630f64201f Correctly handle the library settings being added more than one time on a page diff -r abc9d39cfbe9 -r 7ed2ac0cec27 js/dnd-library.js --- a/js/dnd-library.js Fri Sep 18 15:11:03 2009 +0200 +++ b/js/dnd-library.js Fri Sep 18 15:12:46 2009 +0200 @@ -74,6 +74,12 @@ // Set up empty objects to keep track of things Drupal.settings.dndEditorRepresentations = {}; Drupal.settings.dndLibraryPreviews = {}; + + // Clean up the url if needed (this happen in case drupal_add_js is called + // multiple time for the page) + if (settings.url instanceof Object) { + settings.url = settings.url[0]; + } // Initialize the library $.getJSON(Drupal.settings.basePath + settings.url, function(data) {