Mercurial > defr > drupal > scald > dnd
comparison js/dnd-library.js @ 36:7ed2ac0cec27
Correctly handle the library settings being added more than one time on a page
author | Franck Deroche <franck@defr.org> |
---|---|
date | Fri, 18 Sep 2009 15:12:46 +0200 |
parents | abc9d39cfbe9 |
children | bb510db429c9 |
comparison
equal
deleted
inserted
replaced
35:abc9d39cfbe9 | 36:7ed2ac0cec27 |
---|---|
72 $editor.bind('wysiwygDetach', Drupal.behaviors.dndLibrary.detach_library); | 72 $editor.bind('wysiwygDetach', Drupal.behaviors.dndLibrary.detach_library); |
73 | 73 |
74 // Set up empty objects to keep track of things | 74 // Set up empty objects to keep track of things |
75 Drupal.settings.dndEditorRepresentations = {}; | 75 Drupal.settings.dndEditorRepresentations = {}; |
76 Drupal.settings.dndLibraryPreviews = {}; | 76 Drupal.settings.dndLibraryPreviews = {}; |
77 | |
78 // Clean up the url if needed (this happen in case drupal_add_js is called | |
79 // multiple time for the page) | |
80 if (settings.url instanceof Object) { | |
81 settings.url = settings.url[0]; | |
82 } | |
77 | 83 |
78 // Initialize the library | 84 // Initialize the library |
79 $.getJSON(Drupal.settings.basePath + settings.url, function(data) { | 85 $.getJSON(Drupal.settings.basePath + settings.url, function(data) { |
80 Drupal.behaviors.dndLibrary.renderLibrary.call($this.get(0), data, $editor); | 86 Drupal.behaviors.dndLibrary.renderLibrary.call($this.get(0), data, $editor); |
81 }); | 87 }); |