').text(value.street).html() + ' st., bld. ' + $('
').text(value.building).html();
$(this).html(html);
}
});
}
return {
//main function to initiate the module
init: function () {
// inii ajax simulation
initAjaxMock();
// init editable elements
initEditables();
// init editable toggler
$('#enable').click(function () {
$('#user .editable').editable('toggleDisabled');
});
// init
$('#inline').on('change', function (e) {
if ($(this).is(':checked')) {
window.location.href = 'form_editable.html?mode=inline';
} else {
window.location.href = 'form_editable.html';
}
});
// handle editable elements on hidden event fired
$('#user .editable').on('hidden', function (e, reason) {
if (reason === 'save' || reason === 'nochange') {
var $next = $(this).closest('tr').next().find('.editable');
if ($('#autoopen').is(':checked')) {
setTimeout(function () {
$next.editable('show');
}, 300);
} else {
$next.focus();
}
}
});
}
};
}();