$(function() {
    if ($('#closeaftersave').val() == 'true') {
        if (typeof(opener.reload) == 'function')
            opener.reload("language");
        else
            opener.location.reload();
        self.close();
    }
    $('textarea').elastic();
    $('body').on('click', '#saveFieldFormNotReload', saveFieldNotReload);
});

function saveFieldNotReload() {
    $.post(base + $('#fieldform').attr('action'), $('#fieldform').serializeArray(), function () {       
        self.close();
        return false;
    });
    return false;
}