Title: JavaScript doubles Export and Subscribe buttons
Last modified: May 28, 2024

---

# JavaScript doubles Export and Subscribe buttons

 *  Resolved [mikeknappe](https://wordpress.org/support/users/mikeknappe/)
 * (@mikeknappe)
 * [2 years ago](https://wordpress.org/support/topic/javascript-doubles-export-and-subscribe-buttons/)
 * 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](https://wordpress.org/support/users/mikeknappe/)
 * (@mikeknappe)
 * [2 years ago](https://wordpress.org/support/topic/javascript-doubles-export-and-subscribe-buttons/#post-17785833)
 * 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](https://wordpress.org/support/users/mikeknappe/)
 * (@mikeknappe)
 * [2 years ago](https://wordpress.org/support/topic/javascript-doubles-export-and-subscribe-buttons/#post-17785948)
 * 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](https://wordpress.org/support/users/joedolson/)
 * (@joedolson)
 * [2 years ago](https://wordpress.org/support/topic/javascript-doubles-export-and-subscribe-buttons/#post-17789821)
 * Thanks! Fixed for next release: [https://github.com/joedolson/my-calendar/issues/602](https://github.com/joedolson/my-calendar/issues/602)
 *  Thread Starter [mikeknappe](https://wordpress.org/support/users/mikeknappe/)
 * (@mikeknappe)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/javascript-doubles-export-and-subscribe-buttons/#post-17802632)
 * 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://wordpress.org/support/topic/missing-text-option-for-subscribe-and-export/](https://wordpress.org/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.

 * ![](https://ps.w.org/my-calendar/assets/icon-256x256.png?rev=1097576)
 * [My Calendar - Accessible Event Manager](https://wordpress.org/plugins/my-calendar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/my-calendar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/my-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/my-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/my-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/my-calendar/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [mikeknappe](https://wordpress.org/support/users/mikeknappe/)
 * Last activity: [1 year, 11 months ago](https://wordpress.org/support/topic/javascript-doubles-export-and-subscribe-buttons/#post-17802632)
 * Status: resolved