format json in popup, fit popup to content