• Resolved mikeknappe

    (@mikeknappe)


    Hi there,

    thanks for all your work at this awesome plugin. Since the latest changes/updates there is a problem, if the mini-calender is for example included in a sidebar and on the main page beside it – it doubles the buttons at the button of the widgets.

    If you switch the month in the mini-widget in the sidebar it doubles the buttons in the main widget in the main article and vice-versa.

    Hopefully you are able to reconstruct this error and fix it.

    Best regards,
    Mike

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter mikeknappe

    (@mikeknappe)

    I think it’s mainly because of mc_build_toggles() in mcjs.js

    You don’t divide there, if it’s the mini widget or main widget. Therefore, if both widget (types) are displayed on one page, the double effect will be available.

    Thread Starter mikeknappe

    (@mikeknappe)

    A quick fix would be:

    L237 mc_build_toggles( $( this ).attr( ‘id’ ) );

    L271 function mc_build_toggles( id ) {
    L272 if( id.length > 0 )
    L273 id = ‘#’+id+’ ‘;
    L274 const subscribe = $( id + ‘.mc-subscribe’ );
    L275 const exports = $( id + ‘.mc-download’ );
    L298 const toggles = $( id + ‘.mc-export button’ );

    You get the current id of the widget, transport it into the mc_build_toggles fnc and extend all selectors with the id.

    Have a nice day!

    Plugin Author Joe Dolson

    (@joedolson)

    Thanks! Fixed for next release: https://github.com/joedolson/my-calendar/issues/602

    Thread Starter mikeknappe

    (@mikeknappe)

    Hi Joe, thanks for the fix. The duplication is fixed, if the mini and main are visible on one page.

    I don’t know, what happend, maybe it’s a side-effect of https://ww.wp.xz.cn/support/topic/missing-text-option-for-subscribe-and-export/ or another implementation. Hopefully you have tested it, but the latest release has the following problems:

    1. If you change the month in the mini, the buttons won’t be displayed anymore. They disappear.

    2. If you chane the month in the main, the entry buttons export & subscribe will disappear too – only the buttons Google and iCal will remains; so the submenu itself will stay.

    Currently I’ve no time to track the problem at this point. Hopefully you’ll find another solution to fix this behaviour.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘JavaScript doubles Export and Subscribe buttons’ is closed to new replies.