refactoring code for hide modal before removing or not calculation
refactoring code for hide modal before removing or not calculation


Former-commit-id: 71a16afdc2209355d0e6e3d942c94a83391bc934 [formerly 882e4c6047355a96fbc79456f4757566fc36b334]
Former-commit-id: 79b83acc4516a077a678952b6441b963b6ad37c7
gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine