public
Created

Simple sidebar toggle userscript for the SO Chat system

  • Download Gist
toggle-sidebar.user.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11
$('.sidebar-widget').each(function() {
var container = $('<div></div>'),
btn = $('<button></button>'),
that = this;
btn.text('toggle');
btn.on('click', function() {
$(that).toggle();
});
container = $(this).wrap(container);
$(this.parentNode).append(btn);
});

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.