joomla/joomla-cms — pull request #910 by piotrmocko (2013-03-28 10:05:16+00:00)
Title: Correct usage behavior.modal with custom selector

When you use in Joomla
JHTML::_('behavior.modal');
and
JHTML::_('behavior.modal', 'a.test', array('parse' => false, 'fullScreen'=> true));

it would initialize SqueezeBox twice
and it would also create twice HTML tags: div#sbox-overlay and div#sbox-window

Here is one of many cases when it would not work correct.
When you try to run JavaScript

SqueezeBox.open($('element'), {
onOpen: function(){
$('element_container').inject( $('sbox-content') );
}
});

then it would insert HTML to first copy of SqueezeBox
but second copy of SqueezeBox would be opened with empty content.

SqueezeBox is not a class but a single instance of object which use static IDs.
This correction will prevent from loading HTML code twice.