import {
    tiObj,
    checkTotal,
    updateTotals,
} from "./generic.js"

const $totalAreaInput = $('.ti-total-area__input-total');

function resetFloors(floors) {
    for (let i = 0; i < floors.length; i++) {
        $(floors[i]).find('input').attr('placeholder', '-').val('');
        $(floors[i]).find('.ti-floor__result-value').text('-');
    }
}

$totalAreaInput.on('input', function () {
    const context = $(this).closest('.ti__estimate');
    checkTotal(context);
    updateTotals(context);
    resetFloors(tiObj.system.floors)
});

export { resetFloors }


