gateone.js:  Fixed the bug where opening a dialog could result in an infinite loop.