Révision 3753f249
Ajouté par Assos Assos il y a plus de 10 ans
htmltest/sites/all/modules/ctools/js/modal.js | ||
---|---|---|
99 | 99 |
$('span.modal-title', Drupal.CTools.Modal.modal).html(Drupal.CTools.Modal.currentSettings.loadingText); |
100 | 100 |
Drupal.CTools.Modal.modalContent(Drupal.CTools.Modal.modal, settings.modalOptions, settings.animation, settings.animationSpeed); |
101 | 101 |
$('#modalContent .modal-content').html(Drupal.theme(settings.throbberTheme)); |
102 |
|
|
103 |
// Position autocomplete results based on the scroll position of the modal. |
|
104 |
$('#modalContent .modal-content').delegate('input.form-autocomplete', 'keyup', function() { |
|
105 |
$('#autocomplete').css('top', $(this).position().top + $(this).outerHeight() + $(this).offsetParent().filter('#modal-content').scrollTop()); |
|
106 |
}); |
|
102 | 107 |
}; |
103 | 108 |
|
104 | 109 |
/** |
... | ... | |
222 | 227 |
// AJAX submits specified in this manner automatically submit to the |
223 | 228 |
// normal form action. |
224 | 229 |
element_settings.url = Drupal.CTools.Modal.findURL(this); |
230 |
if (element_settings.url == '') { |
|
231 |
element_settings.url = $(this).closest('form').attr('action'); |
|
232 |
} |
|
225 | 233 |
element_settings.event = 'click'; |
234 |
element_settings.setClick = true; |
|
226 | 235 |
|
227 | 236 |
var base = $this.attr('id'); |
228 | 237 |
Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings); |
... | ... | |
282 | 291 |
// content. This is helpful for allowing users to see error messages at the |
283 | 292 |
// top of a form, etc. |
284 | 293 |
$('#modal-content').html(response.output).scrollTop(0); |
285 |
Drupal.attachBehaviors(); |
|
294 |
|
|
295 |
// Attach behaviors within a modal dialog. |
|
296 |
var settings = response.settings || ajax.settings || Drupal.settings; |
|
297 |
Drupal.attachBehaviors('#modalContent', settings); |
|
286 | 298 |
} |
287 | 299 |
|
288 | 300 |
/** |
Formats disponibles : Unified diff
Weekly update of contrib modules