Open dialogs on the right place when multiple tabs are opened

review2191002