Eric Martin's SimpleModal breaks jquery ui tabs after closing the modal
===

I used [simpleModal][1] and jquery-ui tabs for this project. I have a link named "Filter" on the form that will call FilterModal() to display the modal.

    function FilterModal() {
       $('#divFilterModal').modal();
    } 

Div #divFilterModal is inside _Filter.cshtml.

    <div">@Html.Partial(MVC.Sample._Filter)</div>

Inside **_Filter.cshtml**, I have two link buttons, one is **"Run"** that will execute filter from the selected choices then posting back the result and closes the modal, second is **"Cancel"** that will just close the popup. Also I have used jquery ui Tabs on this control.

     $(document).ready(function () {
        $('#FilterModalTabs').tabs();
     });

So when I click the Filter link, the modal pops up and the tabs is working well. Every thing is ok if I click "Run" button. But when I click the "Cancel" button, when I open again the modal, the tabs are breaking up. Every time I click to another tab, the previous tab will not deselect/unfocus making more tabs opened.

I check the jquery ui script if it was deleted when the modal was close, but it is still there. Any idea on this? thanks in advance


  [1]: http://www.ericmmartin.com/projects/simplemodal/