Mobile layout

this.legends = ... code is both in this method and in _renderLegends method. Is this to maintain compatibility when mobile_enabled is true?