From 38e96dbdaf6b57bb8e193a164697b8b93aa916f6 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 26 Mar 2014 20:37:25 -0400 Subject: Bookmarklet now toggles between expanded & collapsed --- github-show-full-commit-message.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/github-show-full-commit-message.js b/github-show-full-commit-message.js index ee8edab..54486b4 100644 --- a/github-show-full-commit-message.js +++ b/github-show-full-commit-message.js @@ -1,5 +1,12 @@ (function() { if (window.location.href.indexOf('github.com') != -1) { - $('.commit-message .hidden-text-expander .js-details-target').click(); + var $hidden_text_expander = $('.commit-message .hidden-text-expander .js-details-target'); + + if ($('.commit.open').length > 0) { + $('.commit').removeClass('open'); + } + else { + $hidden_text_expander.click(); + } } })(); \ No newline at end of file -- cgit v1.2.3