Resized portlet will not collapse
Hi,
I have multiple collapsible/expandable portlets that can be resized. But when I resize one of them (vertically) that particular portlet is not collapsing afterwards. The other portlets are collapsing just fine. But the one that were used for resizing will not collapse properly after resize.
My code:
- $( function() {
- $( ".portlet" )
- .addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" )
- .find( ".portlet-header" )
- .addClass( "ui-widget-header ui-corner-all" )
- .prepend( "<span class='ui-icon ui-icon-minusthick portlet-toggle'></span>");
-
- $( ".portlet-toggle" ).on( "click", function() {
- var icon = $( this );
- icon.toggleClass( "ui-icon-plusthick ui-icon-minusthick" );
- icon.closest( ".portlet" ).find( ".portlet-content" ).toggle("fast");
- });
- $( "#expand-all" ).click(function() {
- $( ".portlet-content" ).show( "fast" );
- $( ".portlet-toggle" ).toggleClass( "ui-icon-plusthick ui-icon-minusthick");
- });
- $( "#collapse-all" ).click(function() {
- $( ".portlet-content" ).hide( "fast" );
- $( ".portlet-toggle" ).toggleClass( "ui-icon-minusthick ui-icon-plusthick");
- });
-
- $( ".portlet" ).resizable({
- alsoResize: ".portlet-content",
- handles: 's',
- });
- });
Help is much appreciated. Thanks