parent.$.fn.getIndex = function(){
    var $p=$(this).parent().children();
    return $p.index(this);
}
selectedPart = parent.$('#page_parts .ui-tabs-selected').getIndex();
wym = parent.$.wymeditors(selectedPart);
selectedBlock = wym.selected();
if (selectedBlock !== null) {
   $(selectedBlock).append('<%= escape_javascript(@html_for_wym) %>');
} else {
   wym.html(wym.html() + '<%= escape_javascript(@html_for_wym) %>');
}
wym.update();
close_dialog();
wym.close_dialog();
parent.$.fn.getIndex = function(){
    var $p=$(this).parent().children();
    return $p.index(this);
}
selectedPart = parent.$('#page_parts .ui-tabs-active').getIndex();
wym = parent.$.wymeditors(selectedPart);
selectedBlock = wym.selected();
if (selectedBlock !== null) {
   $(selectedBlock).append('<%= escape_javascript(@html_for_wym) %>');
} else {
   wym.html(wym.html() + '<%= escape_javascript(@html_for_wym) %>');
}
wym.update();
close_dialog();
wym.close_dialog();
Fix dialog to work with Refinerycms 2.1.2
Fix dialog to work with Refinerycms 2.1.2
