{"action":"created","comment":{"url":"https://api.github.com/repos/wso2/app-cloud/pulls/comments/63354975","id":63354975,"diff_hunk":"@@ -117,41 +126,99 @@ $(document).ready(function () {\n                 '</span>' +\n                 '</div>' +\n                 '</div>');\n-                \n-            initSelect2(null);\n+\n+            //Initialize select2 container on newly added env variable\n+            var valueElem = $(this).parent().parent().parent().find('#value')[0];\n+            initSelect2(null, valueElem);\n+\n+            //Disable Other environment variables \"Edit\" button\n+            var editElements = document.getElementsByClassName('fw-edit');\n+            for(var i=1; i < editElements.length; i++){\n+                $(editElements[i]).addClass(\"edit-disable\");\n+            }\n+\n         });\n \n-        $(document).on('click', '.fw-edit', function () {\n-            $(this).parent().parent().parent().find('#key')[0].readOnly = false;\n-            $(this).parent().parent().parent().find('#value')[0].readOnly = false;\n+        $(document).on('click', '.fw-edit', function() {\n+            //Disable \"Add Environment Variable\" Button\n+            var addEnv = document.getElementsByClassName('add-env')[0];\n+            $(addEnv).css('pointer-events', 'none');\n+            $(addEnv).attr(\"title\", \"Save Environment Variable to Enable\");\n+\n+            //Disable Other environment variables \"Edit\" button\n+            var parentElement = $(this).parent().filter('.edit-env')[0];\n+            var editElements = document.getElementsByClassName('edit-env');","path":"modules/jaggeryapps/appmgt/src/site/themes/default/templates/envs/template.jag","position":105,"original_position":105,"commit_id":"64de84b8da99f5cc843b65fc16c286a8fe658995","original_commit_id":"64de84b8da99f5cc843b65fc16c286a8fe658995","user":{"login":"danushkaf","id":5301668,"avatar_url":"https://avatars.githubusercontent.com/u/5301668?v=3","gravatar_id":"","url":"https://api.github.com/users/danushkaf","html_url":"https://github.com/danushkaf","followers_url":"https://api.github.com/users/danushkaf/followers","following_url":"https://api.github.com/users/danushkaf/following{/other_user}","gists_url":"https://api.github.com/users/danushkaf/gists{/gist_id}","starred_url":"https://api.github.com/users/danushkaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danushkaf/subscriptions","organizations_url":"https://api.github.com/users/danushkaf/orgs","repos_url":"https://api.github.com/users/danushkaf/repos","events_url":"https://api.github.com/users/danushkaf/events{/privacy}","received_events_url":"https://api.github.com/users/danushkaf/received_events","type":"User","site_admin":false},"body":"Use jquery here also.","created_at":"2016-05-16T13:52:08Z","updated_at":"2016-05-16T13:52:08Z","html_url":"https://github.com/wso2/app-cloud/pull/394#discussion_r63354975","pull_request_url":"https://api.github.com/repos/wso2/app-cloud/pulls/394","_links":{"self":{"href":"https://api.github.com/repos/wso2/app-cloud/pulls/comments/63354975"},"html":{"href":"https://github.com/wso2/app-cloud/pull/394#discussion_r63354975"},"pull_request":{"href":"https://api.github.com/repos/wso2/app-cloud/pulls/394"}}},"pull_request":{"url":"https://api.github.com/repos/wso2/app-cloud/pulls/394","id":70178563,"html_url":"https://github.com/wso2/app-cloud/pull/394","diff_url":"https://github.com/wso2/app-cloud/pull/394.diff","patch_url":"https://github.com/wso2/app-cloud/pull/394.patch","issue_url":"https://api.github.com/repos/wso2/app-cloud/issues/394","number":394,"state":"open","locked":false,"title":"Fix for AppCloud 144 and 148 ","user":{"login":"SabraO","id":5234592,"avatar_url":"https://avatars.githubusercontent.com/u/5234592?v=3","gravatar_id":"","url":"https://api.github.com/users/SabraO","html_url":"https://github.com/SabraO","followers_url":"https://api.github.com/users/SabraO/followers","following_url":"https://api.github.com/users/SabraO/following{/other_user}","gists_url":"https://api.github.com/users/SabraO/gists{/gist_id}","starred_url":"https://api.github.com/users/SabraO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SabraO/subscriptions","organizations_url":"https://api.github.com/users/SabraO/orgs","repos_url":"https://api.github.com/users/SabraO/repos","events_url":"https://api.github.com/users/SabraO/events{/privacy}","received_events_url":"https://api.github.com/users/SabraO/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-16T10:38:19Z","updated_at":"2016-05-16T13:52:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"efbaec9c18883167b9e39afae715a62ff7fff813","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wso2/app-cloud/pulls/394/commits","review_comments_url":"https://api.github.com/repos/wso2/app-cloud/pulls/394/comments","review_comment_url":"https://api.github.com/repos/wso2/app-cloud/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wso2/app-cloud/issues/394/comments","statuses_url":"https://api.github.com/repos/wso2/app-cloud/statuses/64de84b8da99f5cc843b65fc16c286a8fe658995","head":{"label":"SabraO:master","ref":"master","sha":"64de84b8da99f5cc843b65fc16c286a8fe658995","user":{"login":"SabraO","id":5234592,"avatar_url":"https://avatars.githubusercontent.com/u/5234592?v=3","gravatar_id":"","url":"https://api.github.com/users/SabraO","html_url":"https://github.com/SabraO","followers_url":"https://api.github.com/users/SabraO/followers","following_url":"https://api.github.com/users/SabraO/following{/other_user}","gists_url":"https://api.github.com/users/SabraO/gists{/gist_id}","starred_url":"https://api.github.com/users/SabraO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SabraO/subscriptions","organizations_url":"https://api.github.com/users/SabraO/orgs","repos_url":"https://api.github.com/users/SabraO/repos","events_url":"https://api.github.com/users/SabraO/events{/privacy}","received_events_url":"https://api.github.com/users/SabraO/received_events","type":"User","site_admin":false},"repo":{"id":55682661,"name":"app-cloud","full_name":"SabraO/app-cloud","owner":{"login":"SabraO","id":5234592,"avatar_url":"https://avatars.githubusercontent.com/u/5234592?v=3","gravatar_id":"","url":"https://api.github.com/users/SabraO","html_url":"https://github.com/SabraO","followers_url":"https://api.github.com/users/SabraO/followers","following_url":"https://api.github.com/users/SabraO/following{/other_user}","gists_url":"https://api.github.com/users/SabraO/gists{/gist_id}","starred_url":"https://api.github.com/users/SabraO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SabraO/subscriptions","organizations_url":"https://api.github.com/users/SabraO/orgs","repos_url":"https://api.github.com/users/SabraO/repos","events_url":"https://api.github.com/users/SabraO/events{/privacy}","received_events_url":"https://api.github.com/users/SabraO/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SabraO/app-cloud","description":"","fork":true,"url":"https://api.github.com/repos/SabraO/app-cloud","forks_url":"https://api.github.com/repos/SabraO/app-cloud/forks","keys_url":"https://api.github.com/repos/SabraO/app-cloud/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SabraO/app-cloud/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SabraO/app-cloud/teams","hooks_url":"https://api.github.com/repos/SabraO/app-cloud/hooks","issue_events_url":"https://api.github.com/repos/SabraO/app-cloud/issues/events{/number}","events_url":"https://api.github.com/repos/SabraO/app-cloud/events","assignees_url":"https://api.github.com/repos/SabraO/app-cloud/assignees{/user}","branches_url":"https://api.github.com/repos/SabraO/app-cloud/branches{/branch}","tags_url":"https://api.github.com/repos/SabraO/app-cloud/tags","blobs_url":"https://api.github.com/repos/SabraO/app-cloud/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SabraO/app-cloud/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SabraO/app-cloud/git/refs{/sha}","trees_url":"https://api.github.com/repos/SabraO/app-cloud/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SabraO/app-cloud/statuses/{sha}","languages_url":"https://api.github.com/repos/SabraO/app-cloud/languages","stargazers_url":"https://api.github.com/repos/SabraO/app-cloud/stargazers","contributors_url":"https://api.github.com/repos/SabraO/app-cloud/contributors","subscribers_url":"https://api.github.com/repos/SabraO/app-cloud/subscribers","subscription_url":"https://api.github.com/repos/SabraO/app-cloud/subscription","commits_url":"https://api.github.com/repos/SabraO/app-cloud/commits{/sha}","git_commits_url":"https://api.github.com/repos/SabraO/app-cloud/git/commits{/sha}","comments_url":"https://api.github.com/repos/SabraO/app-cloud/comments{/number}","issue_comment_url":"https://api.github.com/repos/SabraO/app-cloud/issues/comments{/number}","contents_url":"https://api.github.com/repos/SabraO/app-cloud/contents/{+path}","compare_url":"https://api.github.com/repos/SabraO/app-cloud/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SabraO/app-cloud/merges","archive_url":"https://api.github.com/repos/SabraO/app-cloud/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SabraO/app-cloud/downloads","issues_url":"https://api.github.com/repos/SabraO/app-cloud/issues{/number}","pulls_url":"https://api.github.com/repos/SabraO/app-cloud/pulls{/number}","milestones_url":"https://api.github.com/repos/SabraO/app-cloud/milestones{/number}","notifications_url":"https://api.github.com/repos/SabraO/app-cloud/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SabraO/app-cloud/labels{/name}","releases_url":"https://api.github.com/repos/SabraO/app-cloud/releases{/id}","deployments_url":"https://api.github.com/repos/SabraO/app-cloud/deployments","created_at":"2016-04-07T09:40:24Z","updated_at":"2016-04-07T09:40:26Z","pushed_at":"2016-05-16T12:54:01Z","git_url":"git://github.com/SabraO/app-cloud.git","ssh_url":"git@github.com:SabraO/app-cloud.git","clone_url":"https://github.com/SabraO/app-cloud.git","svn_url":"https://github.com/SabraO/app-cloud","homepage":null,"size":11029,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"wso2:master","ref":"master","sha":"f6e1c363d695e070712ae8e16f69af22a7be2c7f","user":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"repo":{"id":50903674,"name":"app-cloud","full_name":"wso2/app-cloud","owner":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wso2/app-cloud","description":"","fork":false,"url":"https://api.github.com/repos/wso2/app-cloud","forks_url":"https://api.github.com/repos/wso2/app-cloud/forks","keys_url":"https://api.github.com/repos/wso2/app-cloud/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wso2/app-cloud/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wso2/app-cloud/teams","hooks_url":"https://api.github.com/repos/wso2/app-cloud/hooks","issue_events_url":"https://api.github.com/repos/wso2/app-cloud/issues/events{/number}","events_url":"https://api.github.com/repos/wso2/app-cloud/events","assignees_url":"https://api.github.com/repos/wso2/app-cloud/assignees{/user}","branches_url":"https://api.github.com/repos/wso2/app-cloud/branches{/branch}","tags_url":"https://api.github.com/repos/wso2/app-cloud/tags","blobs_url":"https://api.github.com/repos/wso2/app-cloud/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wso2/app-cloud/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wso2/app-cloud/git/refs{/sha}","trees_url":"https://api.github.com/repos/wso2/app-cloud/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wso2/app-cloud/statuses/{sha}","languages_url":"https://api.github.com/repos/wso2/app-cloud/languages","stargazers_url":"https://api.github.com/repos/wso2/app-cloud/stargazers","contributors_url":"https://api.github.com/repos/wso2/app-cloud/contributors","subscribers_url":"https://api.github.com/repos/wso2/app-cloud/subscribers","subscription_url":"https://api.github.com/repos/wso2/app-cloud/subscription","commits_url":"https://api.github.com/repos/wso2/app-cloud/commits{/sha}","git_commits_url":"https://api.github.com/repos/wso2/app-cloud/git/commits{/sha}","comments_url":"https://api.github.com/repos/wso2/app-cloud/comments{/number}","issue_comment_url":"https://api.github.com/repos/wso2/app-cloud/issues/comments{/number}","contents_url":"https://api.github.com/repos/wso2/app-cloud/contents/{+path}","compare_url":"https://api.github.com/repos/wso2/app-cloud/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wso2/app-cloud/merges","archive_url":"https://api.github.com/repos/wso2/app-cloud/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wso2/app-cloud/downloads","issues_url":"https://api.github.com/repos/wso2/app-cloud/issues{/number}","pulls_url":"https://api.github.com/repos/wso2/app-cloud/pulls{/number}","milestones_url":"https://api.github.com/repos/wso2/app-cloud/milestones{/number}","notifications_url":"https://api.github.com/repos/wso2/app-cloud/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wso2/app-cloud/labels{/name}","releases_url":"https://api.github.com/repos/wso2/app-cloud/releases{/id}","deployments_url":"https://api.github.com/repos/wso2/app-cloud/deployments","created_at":"2016-02-02T07:49:41Z","updated_at":"2016-05-15T00:34:07Z","pushed_at":"2016-05-16T12:54:01Z","git_url":"git://github.com/wso2/app-cloud.git","ssh_url":"git@github.com:wso2/app-cloud.git","clone_url":"https://github.com/wso2/app-cloud.git","svn_url":"https://github.com/wso2/app-cloud","homepage":null,"size":11080,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":3,"forks":17,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wso2/app-cloud/pulls/394"},"html":{"href":"https://github.com/wso2/app-cloud/pull/394"},"issue":{"href":"https://api.github.com/repos/wso2/app-cloud/issues/394"},"comments":{"href":"https://api.github.com/repos/wso2/app-cloud/issues/394/comments"},"review_comments":{"href":"https://api.github.com/repos/wso2/app-cloud/pulls/394/comments"},"review_comment":{"href":"https://api.github.com/repos/wso2/app-cloud/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wso2/app-cloud/pulls/394/commits"},"statuses":{"href":"https://api.github.com/repos/wso2/app-cloud/statuses/64de84b8da99f5cc843b65fc16c286a8fe658995"}}}}