Fixed jshint error(Refactoring linkDialog with promise).