{"action":"created","comment":{"url":"https://api.github.com/repos/google/ggrc-core/pulls/comments/28575599","id":28575599,"diff_hunk":"@@ -378,7 +378,102 @@ CMS.Controllers.TreeLoader(\"CMS.Controllers.TreeView\", {\n       this.options = new can.Observe(this.constructor.defaults).attr(opts.model ? opts.model[opts.options_property || this.constructor.defaults.options_property] : {}).attr(opts);\n     }\n   }\n+\n+  //Update the default attribute list for tree-view drop-down menu for a specific model\n+  , update_default_attr_list: function(model_name) {\n+    var select_attr_list = [], i;\n+\n+    var model = CMS.Models[model_name] ;\n+\n+    if (model.tree_view_options.attr_list) {\n+      can.each(model.tree_view_options.attr_list, function (item) {\n+        select_attr_list.push(item);\n+      });\n+    }\n+    else {\n+      can.each(can.Model.Cacheable.attr_list, function (item) {\n+        select_attr_list.push(item);\n+      });\n+    }\n+\n+    //Initialize the display status for title, owner, status to be true\n+    for (i = 0; i < select_attr_list.length; i++) {\n+      var obj = select_attr_list[i];\n+      if (obj.attr_name === 'title' || obj.attr_name === 'owner' || obj.attr_name === 'status') {\n+        obj.display_status = 'true';\n+      }\n+      else {\n+        obj.display_status = 'false';\n+      }\n+    }\n+\n+    this.options.select_attr_list = select_attr_list;\n+    this.options.attr('select_attr_list', this.options.select_attr_list);\n+\n+  }\n+\n+  //Get the custom attribute list from the server and add the list to\n+  //select attribute list\n+  , update_custom_attr_list: function(model_name) {\n+    var custom_attr_list = [], dfd = $.Deferred(), that = this;\n+    CMS.Models.CustomAttributeDefinition.findAll({definition_type: model_name})\n+      .then(function (defs) {\n+        if (defs.length) {\n+          //create custom_attr_list\n+          var i;\n+          for (i = 0; i < defs.length; i++) {\n+            if (defs[i].attribute_type !== 'Rich Text') {\n+              var obj = {};\n+              obj.attr_title = defs[i].title;\n+              obj.attr_name = defs[i].title;\n+              obj.display_status = 'false';\n+              obj.attr_type = 'custom';\n+              custom_attr_list.push(obj);\n+            }\n+          }\n+          //update this.options.select_attr_list\n+          can.each(custom_attr_list, function (item) {\n+            that.options.select_attr_list.push(item);\n+          });\n+          that.options.attr('select_attr_list', that.options.select_attr_list);\n+        }\n+        dfd.resolve();\n+      })","path":"src/ggrc/assets/javascripts/controllers/tree_view_controller.js","position":64,"original_position":64,"commit_id":"caa529ebdc350b6b027646e3683abefd706c838b","original_commit_id":"caa529ebdc350b6b027646e3683abefd706c838b","user":{"login":"hyperNURb","id":59742,"avatar_url":"https://avatars.githubusercontent.com/u/59742?v=3","gravatar_id":"","url":"https://api.github.com/users/hyperNURb","html_url":"https://github.com/hyperNURb","followers_url":"https://api.github.com/users/hyperNURb/followers","following_url":"https://api.github.com/users/hyperNURb/following{/other_user}","gists_url":"https://api.github.com/users/hyperNURb/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperNURb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperNURb/subscriptions","organizations_url":"https://api.github.com/users/hyperNURb/orgs","repos_url":"https://api.github.com/users/hyperNURb/repos","events_url":"https://api.github.com/users/hyperNURb/events{/privacy}","received_events_url":"https://api.github.com/users/hyperNURb/received_events","type":"User","site_admin":false},"body":"Two things here:\r\n- You are missing semicolon `})`\r\n- You can use `.bind(this)` and avoid making `that`\r\n","created_at":"2015-04-17T07:49:42Z","updated_at":"2015-04-17T07:49:42Z","html_url":"https://github.com/google/ggrc-core/pull/2596#discussion_r28575599","pull_request_url":"https://api.github.com/repos/google/ggrc-core/pulls/2596","_links":{"self":{"href":"https://api.github.com/repos/google/ggrc-core/pulls/comments/28575599"},"html":{"href":"https://github.com/google/ggrc-core/pull/2596#discussion_r28575599"},"pull_request":{"href":"https://api.github.com/repos/google/ggrc-core/pulls/2596"}}},"pull_request":{"url":"https://api.github.com/repos/google/ggrc-core/pulls/2596","id":32928543,"html_url":"https://github.com/google/ggrc-core/pull/2596","diff_url":"https://github.com/google/ggrc-core/pull/2596.diff","patch_url":"https://github.com/google/ggrc-core/pull/2596.patch","issue_url":"https://api.github.com/repos/google/ggrc-core/issues/2596","number":2596,"state":"open","locked":false,"title":"Feature/selectable tree view header core 1546","user":{"login":"sasmita514","id":7494400,"avatar_url":"https://avatars.githubusercontent.com/u/7494400?v=3","gravatar_id":"","url":"https://api.github.com/users/sasmita514","html_url":"https://github.com/sasmita514","followers_url":"https://api.github.com/users/sasmita514/followers","following_url":"https://api.github.com/users/sasmita514/following{/other_user}","gists_url":"https://api.github.com/users/sasmita514/gists{/gist_id}","starred_url":"https://api.github.com/users/sasmita514/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sasmita514/subscriptions","organizations_url":"https://api.github.com/users/sasmita514/orgs","repos_url":"https://api.github.com/users/sasmita514/repos","events_url":"https://api.github.com/users/sasmita514/events{/privacy}","received_events_url":"https://api.github.com/users/sasmita514/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-09T06:33:36Z","updated_at":"2015-04-17T07:49:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"843411dfd8bd8b259dd77881e72f6014531d5995","assignee":null,"milestone":{"url":"https://api.github.com/repos/google/ggrc-core/milestones/13","html_url":"https://github.com/google/ggrc-core/milestones/0.9.3-Mango","labels_url":"https://api.github.com/repos/google/ggrc-core/milestones/13/labels","id":1036816,"number":13,"title":"0.9.3-Mango","description":"","creator":{"login":"Smotko","id":513444,"avatar_url":"https://avatars.githubusercontent.com/u/513444?v=3","gravatar_id":"","url":"https://api.github.com/users/Smotko","html_url":"https://github.com/Smotko","followers_url":"https://api.github.com/users/Smotko/followers","following_url":"https://api.github.com/users/Smotko/following{/other_user}","gists_url":"https://api.github.com/users/Smotko/gists{/gist_id}","starred_url":"https://api.github.com/users/Smotko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Smotko/subscriptions","organizations_url":"https://api.github.com/users/Smotko/orgs","repos_url":"https://api.github.com/users/Smotko/repos","events_url":"https://api.github.com/users/Smotko/events{/privacy}","received_events_url":"https://api.github.com/users/Smotko/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":3,"state":"open","created_at":"2015-03-24T17:45:35Z","updated_at":"2015-04-17T06:53:19Z","due_on":"2015-05-14T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/google/ggrc-core/pulls/2596/commits","review_comments_url":"https://api.github.com/repos/google/ggrc-core/pulls/2596/comments","review_comment_url":"https://api.github.com/repos/google/ggrc-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/ggrc-core/issues/2596/comments","statuses_url":"https://api.github.com/repos/google/ggrc-core/statuses/caa529ebdc350b6b027646e3683abefd706c838b","head":{"label":"google:feature/selectable-tree-view-header-CORE-1546","ref":"feature/selectable-tree-view-header-CORE-1546","sha":"caa529ebdc350b6b027646e3683abefd706c838b","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":9304637,"name":"ggrc-core","full_name":"google/ggrc-core","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/ggrc-core","description":"GGRC Core","fork":false,"url":"https://api.github.com/repos/google/ggrc-core","forks_url":"https://api.github.com/repos/google/ggrc-core/forks","keys_url":"https://api.github.com/repos/google/ggrc-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/ggrc-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/ggrc-core/teams","hooks_url":"https://api.github.com/repos/google/ggrc-core/hooks","issue_events_url":"https://api.github.com/repos/google/ggrc-core/issues/events{/number}","events_url":"https://api.github.com/repos/google/ggrc-core/events","assignees_url":"https://api.github.com/repos/google/ggrc-core/assignees{/user}","branches_url":"https://api.github.com/repos/google/ggrc-core/branches{/branch}","tags_url":"https://api.github.com/repos/google/ggrc-core/tags","blobs_url":"https://api.github.com/repos/google/ggrc-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/ggrc-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/ggrc-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/ggrc-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/ggrc-core/statuses/{sha}","languages_url":"https://api.github.com/repos/google/ggrc-core/languages","stargazers_url":"https://api.github.com/repos/google/ggrc-core/stargazers","contributors_url":"https://api.github.com/repos/google/ggrc-core/contributors","subscribers_url":"https://api.github.com/repos/google/ggrc-core/subscribers","subscription_url":"https://api.github.com/repos/google/ggrc-core/subscription","commits_url":"https://api.github.com/repos/google/ggrc-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/ggrc-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/ggrc-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/ggrc-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/ggrc-core/contents/{+path}","compare_url":"https://api.github.com/repos/google/ggrc-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/ggrc-core/merges","archive_url":"https://api.github.com/repos/google/ggrc-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/ggrc-core/downloads","issues_url":"https://api.github.com/repos/google/ggrc-core/issues{/number}","pulls_url":"https://api.github.com/repos/google/ggrc-core/pulls{/number}","milestones_url":"https://api.github.com/repos/google/ggrc-core/milestones{/number}","notifications_url":"https://api.github.com/repos/google/ggrc-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/ggrc-core/labels{/name}","releases_url":"https://api.github.com/repos/google/ggrc-core/releases{/id}","created_at":"2013-04-08T19:16:28Z","updated_at":"2015-04-16T10:13:55Z","pushed_at":"2015-04-17T07:15:13Z","git_url":"git://github.com/google/ggrc-core.git","ssh_url":"git@github.com:google/ggrc-core.git","clone_url":"https://github.com/google/ggrc-core.git","svn_url":"https://github.com/google/ggrc-core","homepage":null,"size":62866,"stargazers_count":18,"watchers_count":18,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":13,"forks":12,"open_issues":13,"watchers":18,"default_branch":"develop"}},"base":{"label":"google:epic/mango","ref":"epic/mango","sha":"db54c89c8154378ce3e938fa3162d0918872d250","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":9304637,"name":"ggrc-core","full_name":"google/ggrc-core","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/ggrc-core","description":"GGRC Core","fork":false,"url":"https://api.github.com/repos/google/ggrc-core","forks_url":"https://api.github.com/repos/google/ggrc-core/forks","keys_url":"https://api.github.com/repos/google/ggrc-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/ggrc-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/ggrc-core/teams","hooks_url":"https://api.github.com/repos/google/ggrc-core/hooks","issue_events_url":"https://api.github.com/repos/google/ggrc-core/issues/events{/number}","events_url":"https://api.github.com/repos/google/ggrc-core/events","assignees_url":"https://api.github.com/repos/google/ggrc-core/assignees{/user}","branches_url":"https://api.github.com/repos/google/ggrc-core/branches{/branch}","tags_url":"https://api.github.com/repos/google/ggrc-core/tags","blobs_url":"https://api.github.com/repos/google/ggrc-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/ggrc-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/ggrc-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/ggrc-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/ggrc-core/statuses/{sha}","languages_url":"https://api.github.com/repos/google/ggrc-core/languages","stargazers_url":"https://api.github.com/repos/google/ggrc-core/stargazers","contributors_url":"https://api.github.com/repos/google/ggrc-core/contributors","subscribers_url":"https://api.github.com/repos/google/ggrc-core/subscribers","subscription_url":"https://api.github.com/repos/google/ggrc-core/subscription","commits_url":"https://api.github.com/repos/google/ggrc-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/ggrc-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/ggrc-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/ggrc-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/ggrc-core/contents/{+path}","compare_url":"https://api.github.com/repos/google/ggrc-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/ggrc-core/merges","archive_url":"https://api.github.com/repos/google/ggrc-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/ggrc-core/downloads","issues_url":"https://api.github.com/repos/google/ggrc-core/issues{/number}","pulls_url":"https://api.github.com/repos/google/ggrc-core/pulls{/number}","milestones_url":"https://api.github.com/repos/google/ggrc-core/milestones{/number}","notifications_url":"https://api.github.com/repos/google/ggrc-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/ggrc-core/labels{/name}","releases_url":"https://api.github.com/repos/google/ggrc-core/releases{/id}","created_at":"2013-04-08T19:16:28Z","updated_at":"2015-04-16T10:13:55Z","pushed_at":"2015-04-17T07:15:13Z","git_url":"git://github.com/google/ggrc-core.git","ssh_url":"git@github.com:google/ggrc-core.git","clone_url":"https://github.com/google/ggrc-core.git","svn_url":"https://github.com/google/ggrc-core","homepage":null,"size":62866,"stargazers_count":18,"watchers_count":18,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":13,"forks":12,"open_issues":13,"watchers":18,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/google/ggrc-core/pulls/2596"},"html":{"href":"https://github.com/google/ggrc-core/pull/2596"},"issue":{"href":"https://api.github.com/repos/google/ggrc-core/issues/2596"},"comments":{"href":"https://api.github.com/repos/google/ggrc-core/issues/2596/comments"},"review_comments":{"href":"https://api.github.com/repos/google/ggrc-core/pulls/2596/comments"},"review_comment":{"href":"https://api.github.com/repos/google/ggrc-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/ggrc-core/pulls/2596/commits"},"statuses":{"href":"https://api.github.com/repos/google/ggrc-core/statuses/caa529ebdc350b6b027646e3683abefd706c838b"}}}}