5

2

Case with large blocks of code can be too long to read comfortably. Then it would be nice to be able to 'collapse' the code block. Is that possible?

flag

1 Answer

8

Actually, that wasn't a real question. It's the other way around: I implemented a customization doing this, and thought it could be helpful to other happy Code Snippet plugin users.

Here it is:

name:          Collapse Code Blocks
description:   Collapse/expand a code block by double-clicking it
author:        Michel de Ruiter
version:       1.0.0.2

js:

$("div.codesnippet").attr("title", "Double-click to collapse/expand")
.dblclick(function() {
  $(this).toggleClass("collapsed");
});


css:

div.codesnippet.collapsed {
  height: 15px;
  background-color: #BBB;
  overflow: hidden !important;
  cursor: default;
}

Edit: I changed it to double-click, to avoid trouble selecting code.

link|flag
Very cool! Users with BugMonkey 2.0 that have enabled importing customizations should be able to send this to their FogBugz (after being saved it will show up under "Customizations You Own") – Daniel LeCheminant Dec 22 2010 at 23:06
If anyone wants triple-click, just ask. :-) – Michel de Ruiter Nov 14 at 19:33

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.