moved widget expansion/contraction/close features into directives.