malsup / blockui

jQuery BlockUI Plugin
http://jquery.malsup.com/block/
1.69k stars 506 forks source link

Blocking multiple elements with jQuery selector as message doesn't work #20

Closed bryanbak closed 13 years ago

bryanbak commented 13 years ago

When I try to block multiple elements and use a jQuery selector as the message, the message only shows up in the last element to be blocked. After making a call to unblock the original message is not inserted back into the dom.

Here is an example on how to reproduce:

<div class="foo"></div>
<div class="foo"></div>
<div id="ajaxMessage"></div>

<script type="text/javascript">
$('.foo').block({ message: $('#ajaxMessage') });
$('.foo').unblock();
</script>

After the block call only the second div has the message showing up. Once the unblock call is made the #ajaxMessage div is no longer on the page.

malsup commented 13 years ago

That's not supported. This plugin makes no attempt at cloning the message.

bryanbak commented 13 years ago

That's good to know. I'll just set a static message then. You might mention in the documentation that if you use a jQuery selector as the message that you can only block 1 element at a time. Thanks for the quick response.