{"action":"created","issue":{"url":"https://api.github.com/repos/enonic/xp/issues/3131","repository_url":"https://api.github.com/repos/enonic/xp","labels_url":"https://api.github.com/repos/enonic/xp/issues/3131/labels{/name}","comments_url":"https://api.github.com/repos/enonic/xp/issues/3131/comments","events_url":"https://api.github.com/repos/enonic/xp/issues/3131/events","html_url":"https://github.com/enonic/xp/pull/3131","id":147438027,"number":3131,"title":"XP-3131 SiteConfigurator dilaog should be closed, when 'edit' button …","user":{"login":"edloidas","id":1847621,"avatar_url":"https://avatars.githubusercontent.com/u/1847621?v=3","gravatar_id":"","url":"https://api.github.com/users/edloidas","html_url":"https://github.com/edloidas","followers_url":"https://api.github.com/users/edloidas/followers","following_url":"https://api.github.com/users/edloidas/following{/other_user}","gists_url":"https://api.github.com/users/edloidas/gists{/gist_id}","starred_url":"https://api.github.com/users/edloidas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edloidas/subscriptions","organizations_url":"https://api.github.com/users/edloidas/orgs","repos_url":"https://api.github.com/users/edloidas/repos","events_url":"https://api.github.com/users/edloidas/events{/privacy}","received_events_url":"https://api.github.com/users/edloidas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-11T13:57:54Z","updated_at":"2016-04-12T10:08:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/enonic/xp/pulls/3131","html_url":"https://github.com/enonic/xp/pull/3131","diff_url":"https://github.com/enonic/xp/pull/3131.diff","patch_url":"https://github.com/enonic/xp/pull/3131.patch"},"body":"…for the background pressed and wizard for image opened\r\n\r\nClose dialog on image edit request."},"comment":{"url":"https://api.github.com/repos/enonic/xp/issues/comments/208829451","html_url":"https://github.com/enonic/xp/pull/3131#issuecomment-208829451","issue_url":"https://api.github.com/repos/enonic/xp/issues/3131","id":208829451,"user":{"login":"alansemenov","id":11612490,"avatar_url":"https://avatars.githubusercontent.com/u/11612490?v=3","gravatar_id":"","url":"https://api.github.com/users/alansemenov","html_url":"https://github.com/alansemenov","followers_url":"https://api.github.com/users/alansemenov/followers","following_url":"https://api.github.com/users/alansemenov/following{/other_user}","gists_url":"https://api.github.com/users/alansemenov/gists{/gist_id}","starred_url":"https://api.github.com/users/alansemenov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alansemenov/subscriptions","organizations_url":"https://api.github.com/users/alansemenov/orgs","repos_url":"https://api.github.com/users/alansemenov/repos","events_url":"https://api.github.com/users/alansemenov/events{/privacy}","received_events_url":"https://api.github.com/users/alansemenov/received_events","type":"User","site_admin":false},"created_at":"2016-04-12T10:08:18Z","updated_at":"2016-04-12T10:08:18Z","body":"I know about const and I don't have anything against using it but only when it's justified according to its purpose which is to store a fixed value that will be used further in the code. But that is not the case in this specific example. This looks very confusing when we define a new constant on each iteration inside a loop when we in fact need only one variable that should be defined outside of the loop and used as a temporary storage to add an event handler to an element.\r\n\r\n```Typescript\r\nprivate handleDialogClose(formView: FormView) {\r\n    let imageSelector;\r\n    formView.getChildren().forEach((element: api.dom.Element) => {\r\n        if (api.ObjectHelper.iFrameSafeInstanceOf(element, InputView)) {\r\n            imageSelector = (<InputView> element).getInputTypeView().getElement();\r\n            if (api.ObjectHelper.iFrameSafeInstanceOf(imageSelector, ImageSelector)) {\r\n                (<ImageSelector> imageSelector).onEditContentRequest(this.close.bind(this));\r\n            }\r\n        }\r\n    });\r\n}\r\n```"}}