js/calc-controller.js
/* Change button color when pressed. */
Change button color when pressed.
Change button color when pressed .
function btnColorController() {
    view.all.forEach((btn) => {
        btn.color = btn.style['background-color'];
    });
    view.all.forEach((btn) => {
        btn.addEventListener('mousedown', () => {
            btn.classList.add('pressed');
        }, false);
    });
    document.addEventListener('mouseup', (e) => {
        view.all.forEach((btn) => {
            btn.classList.remove('pressed');
        });
        e.stopPropagation();
    }, true);
}
function btnColorController ( ) { view . all . forEach ( ( btn ) => { btn . color = btn . style [ 'background-color' ] ; } ) ; view . all . forEach ( ( btn ) => { btn . addEventListener ( 'mousedown' , ( ) => { btn . classList . add ( 'pressed' ) ; } , false ) ; } ) ; document . addEventListener ( 'mouseup' , ( e ) => { view . all . forEach ( ( btn ) => { btn . classList . remove ( 'pressed' ) ; } ) ; e . stopPropagation ( ) ; } , true ) ; }
Change button color when pressed.
Change button color when pressed .