{"action":"created","comment":{"url":"https://api.github.com/repos/adobe-photoshop/spaces-design/pulls/comments/35813415","id":35813415,"diff_hunk":"@@ -335,17 +337,20 @@ define(function (require, exports) {\n             return Promise.resolve();\n         }\n \n-        var docRef = docAdapter.referenceBy.id(currentDocument.id),\n-            location = { x: 100, y: 100 },\n-            representation = element.getPrimaryRepresentation();\n-\n-        return Promise.fromNode(function (cb) {\n-            representation.getContentPath(cb);\n-        }).then(function (path) {\n-            var placeObj = libraryAdapter.placeElement(docRef, element, path, location);\n-\n-            return descriptor.playObject(placeObj);\n-        });\n+        return Promise\n+                .fromNode(function (cb) {\n+                    element.getPrimaryRepresentation().getContentPath(cb);\n+                })\n+                .bind(this)\n+                .then(function (path) {\n+                    var docRef = docAdapter.referenceBy.id(currentDocument.id),\n+                        placeObj = libraryAdapter.placeElement(docRef, element, path, location);\n+\n+                    return descriptor.playObject(placeObj);\n+                })\n+                .then(function () {\n+                    this.flux.actions.documents.updateDocument();","path":"src/js/actions/libraries.js","position":46,"original_position":46,"commit_id":"8bace5b263f5fc0a33bf40236e52d308d9f43b5e","original_commit_id":"8bace5b263f5fc0a33bf40236e52d308d9f43b5e","user":{"login":"volfied","id":386714,"avatar_url":"https://avatars.githubusercontent.com/u/386714?v=3","gravatar_id":"","url":"https://api.github.com/users/volfied","html_url":"https://github.com/volfied","followers_url":"https://api.github.com/users/volfied/followers","following_url":"https://api.github.com/users/volfied/following{/other_user}","gists_url":"https://api.github.com/users/volfied/gists{/gist_id}","starred_url":"https://api.github.com/users/volfied/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/volfied/subscriptions","organizations_url":"https://api.github.com/users/volfied/orgs","repos_url":"https://api.github.com/users/volfied/repos","events_url":"https://api.github.com/users/volfied/events{/privacy}","received_events_url":"https://api.github.com/users/volfied/received_events","type":"User","site_admin":false},"body":"Is there a way we can do this without an updateDocument call? Can we get the layer and pass this to addLayer somehow?","created_at":"2015-07-29T21:19:28Z","updated_at":"2015-07-29T21:19:28Z","html_url":"https://github.com/adobe-photoshop/spaces-design/pull/1855#discussion_r35813415","pull_request_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/pulls/1855","_links":{"self":{"href":"https://api.github.com/repos/adobe-photoshop/spaces-design/pulls/comments/35813415"},"html":{"href":"https://github.com/adobe-photoshop/spaces-design/pull/1855#discussion_r35813415"},"pull_request":{"href":"https://api.github.com/repos/adobe-photoshop/spaces-design/pulls/1855"}}},"pull_request":{"url":"https://api.github.com/repos/adobe-photoshop/spaces-design/pulls/1855","id":41091339,"html_url":"https://github.com/adobe-photoshop/spaces-design/pull/1855","diff_url":"https://github.com/adobe-photoshop/spaces-design/pull/1855.diff","patch_url":"https://github.com/adobe-photoshop/spaces-design/pull/1855.patch","issue_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/issues/1855","number":1855,"state":"open","locked":false,"title":"Drag and drop graphic asset from libraries panel to canvas","user":{"login":"shaoshing","id":118264,"avatar_url":"https://avatars.githubusercontent.com/u/118264?v=3","gravatar_id":"","url":"https://api.github.com/users/shaoshing","html_url":"https://github.com/shaoshing","followers_url":"https://api.github.com/users/shaoshing/followers","following_url":"https://api.github.com/users/shaoshing/following{/other_user}","gists_url":"https://api.github.com/users/shaoshing/gists{/gist_id}","starred_url":"https://api.github.com/users/shaoshing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaoshing/subscriptions","organizations_url":"https://api.github.com/users/shaoshing/orgs","repos_url":"https://api.github.com/users/shaoshing/repos","events_url":"https://api.github.com/users/shaoshing/events{/privacy}","received_events_url":"https://api.github.com/users/shaoshing/received_events","type":"User","site_admin":false},"body":"This PR implements the drag-and-drop of graphic asset from libraries panel to canvas. Works as below:\r\n\r\n![lib-dnd](https://cloud.githubusercontent.com/assets/118264/8951265/c4e28e0a-3580-11e5-8934-189928a88420.gif)\r\n( For now, you have to double click the dropped asset to quit the transform mode, before you can do anything else )\r\n\r\n@volfied please review ","created_at":"2015-07-29T06:37:32Z","updated_at":"2015-07-29T21:19:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"79c09efa4952b44576c04688eed36b9f5e0da847","assignee":{"login":"volfied","id":386714,"avatar_url":"https://avatars.githubusercontent.com/u/386714?v=3","gravatar_id":"","url":"https://api.github.com/users/volfied","html_url":"https://github.com/volfied","followers_url":"https://api.github.com/users/volfied/followers","following_url":"https://api.github.com/users/volfied/following{/other_user}","gists_url":"https://api.github.com/users/volfied/gists{/gist_id}","starred_url":"https://api.github.com/users/volfied/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/volfied/subscriptions","organizations_url":"https://api.github.com/users/volfied/orgs","repos_url":"https://api.github.com/users/volfied/repos","events_url":"https://api.github.com/users/volfied/events{/privacy}","received_events_url":"https://api.github.com/users/volfied/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/pulls/1855/commits","review_comments_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/pulls/1855/comments","review_comment_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/pulls/comments{/number}","comments_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/issues/1855/comments","statuses_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/statuses/8bace5b263f5fc0a33bf40236e52d308d9f43b5e","head":{"label":"adobe-photoshop:shao/libraries-drag-n-drop","ref":"shao/libraries-drag-n-drop","sha":"8bace5b263f5fc0a33bf40236e52d308d9f43b5e","user":{"login":"adobe-photoshop","id":4542585,"avatar_url":"https://avatars.githubusercontent.com/u/4542585?v=3","gravatar_id":"","url":"https://api.github.com/users/adobe-photoshop","html_url":"https://github.com/adobe-photoshop","followers_url":"https://api.github.com/users/adobe-photoshop/followers","following_url":"https://api.github.com/users/adobe-photoshop/following{/other_user}","gists_url":"https://api.github.com/users/adobe-photoshop/gists{/gist_id}","starred_url":"https://api.github.com/users/adobe-photoshop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adobe-photoshop/subscriptions","organizations_url":"https://api.github.com/users/adobe-photoshop/orgs","repos_url":"https://api.github.com/users/adobe-photoshop/repos","events_url":"https://api.github.com/users/adobe-photoshop/events{/privacy}","received_events_url":"https://api.github.com/users/adobe-photoshop/received_events","type":"Organization","site_admin":false},"repo":{"id":37291353,"name":"spaces-design","full_name":"adobe-photoshop/spaces-design","owner":{"login":"adobe-photoshop","id":4542585,"avatar_url":"https://avatars.githubusercontent.com/u/4542585?v=3","gravatar_id":"","url":"https://api.github.com/users/adobe-photoshop","html_url":"https://github.com/adobe-photoshop","followers_url":"https://api.github.com/users/adobe-photoshop/followers","following_url":"https://api.github.com/users/adobe-photoshop/following{/other_user}","gists_url":"https://api.github.com/users/adobe-photoshop/gists{/gist_id}","starred_url":"https://api.github.com/users/adobe-photoshop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adobe-photoshop/subscriptions","organizations_url":"https://api.github.com/users/adobe-photoshop/orgs","repos_url":"https://api.github.com/users/adobe-photoshop/repos","events_url":"https://api.github.com/users/adobe-photoshop/events{/privacy}","received_events_url":"https://api.github.com/users/adobe-photoshop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/adobe-photoshop/spaces-design","description":"Adobe Photoshop Design Space","fork":false,"url":"https://api.github.com/repos/adobe-photoshop/spaces-design","forks_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/forks","keys_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/teams","hooks_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/hooks","issue_events_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/issues/events{/number}","events_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/events","assignees_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/assignees{/user}","branches_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/branches{/branch}","tags_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/tags","blobs_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/git/refs{/sha}","trees_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/statuses/{sha}","languages_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/languages","stargazers_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/stargazers","contributors_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/contributors","subscribers_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/subscribers","subscription_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/subscription","commits_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/commits{/sha}","git_commits_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/git/commits{/sha}","comments_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/comments{/number}","issue_comment_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/issues/comments{/number}","contents_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/contents/{+path}","compare_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/merges","archive_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/downloads","issues_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/issues{/number}","pulls_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/pulls{/number}","milestones_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/milestones{/number}","notifications_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/labels{/name}","releases_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/releases{/id}","created_at":"2015-06-11T23:23:47Z","updated_at":"2015-07-29T09:53:10Z","pushed_at":"2015-07-29T21:16:41Z","git_url":"git://github.com/adobe-photoshop/spaces-design.git","ssh_url":"git@github.com:adobe-photoshop/spaces-design.git","clone_url":"https://github.com/adobe-photoshop/spaces-design.git","svn_url":"https://github.com/adobe-photoshop/spaces-design","homepage":"http://adobe-photoshop.github.io/","size":15906,"stargazers_count":592,"watchers_count":592,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":150,"forks":41,"open_issues":150,"watchers":592,"default_branch":"master"}},"base":{"label":"adobe-photoshop:master","ref":"master","sha":"f6414ccba545a55344273317d2c5c2e705388406","user":{"login":"adobe-photoshop","id":4542585,"avatar_url":"https://avatars.githubusercontent.com/u/4542585?v=3","gravatar_id":"","url":"https://api.github.com/users/adobe-photoshop","html_url":"https://github.com/adobe-photoshop","followers_url":"https://api.github.com/users/adobe-photoshop/followers","following_url":"https://api.github.com/users/adobe-photoshop/following{/other_user}","gists_url":"https://api.github.com/users/adobe-photoshop/gists{/gist_id}","starred_url":"https://api.github.com/users/adobe-photoshop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adobe-photoshop/subscriptions","organizations_url":"https://api.github.com/users/adobe-photoshop/orgs","repos_url":"https://api.github.com/users/adobe-photoshop/repos","events_url":"https://api.github.com/users/adobe-photoshop/events{/privacy}","received_events_url":"https://api.github.com/users/adobe-photoshop/received_events","type":"Organization","site_admin":false},"repo":{"id":37291353,"name":"spaces-design","full_name":"adobe-photoshop/spaces-design","owner":{"login":"adobe-photoshop","id":4542585,"avatar_url":"https://avatars.githubusercontent.com/u/4542585?v=3","gravatar_id":"","url":"https://api.github.com/users/adobe-photoshop","html_url":"https://github.com/adobe-photoshop","followers_url":"https://api.github.com/users/adobe-photoshop/followers","following_url":"https://api.github.com/users/adobe-photoshop/following{/other_user}","gists_url":"https://api.github.com/users/adobe-photoshop/gists{/gist_id}","starred_url":"https://api.github.com/users/adobe-photoshop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adobe-photoshop/subscriptions","organizations_url":"https://api.github.com/users/adobe-photoshop/orgs","repos_url":"https://api.github.com/users/adobe-photoshop/repos","events_url":"https://api.github.com/users/adobe-photoshop/events{/privacy}","received_events_url":"https://api.github.com/users/adobe-photoshop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/adobe-photoshop/spaces-design","description":"Adobe Photoshop Design Space","fork":false,"url":"https://api.github.com/repos/adobe-photoshop/spaces-design","forks_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/forks","keys_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/teams","hooks_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/hooks","issue_events_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/issues/events{/number}","events_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/events","assignees_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/assignees{/user}","branches_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/branches{/branch}","tags_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/tags","blobs_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/git/refs{/sha}","trees_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/statuses/{sha}","languages_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/languages","stargazers_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/stargazers","contributors_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/contributors","subscribers_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/subscribers","subscription_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/subscription","commits_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/commits{/sha}","git_commits_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/git/commits{/sha}","comments_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/comments{/number}","issue_comment_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/issues/comments{/number}","contents_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/contents/{+path}","compare_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/merges","archive_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/downloads","issues_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/issues{/number}","pulls_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/pulls{/number}","milestones_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/milestones{/number}","notifications_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/labels{/name}","releases_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/releases{/id}","created_at":"2015-06-11T23:23:47Z","updated_at":"2015-07-29T09:53:10Z","pushed_at":"2015-07-29T21:16:41Z","git_url":"git://github.com/adobe-photoshop/spaces-design.git","ssh_url":"git@github.com:adobe-photoshop/spaces-design.git","clone_url":"https://github.com/adobe-photoshop/spaces-design.git","svn_url":"https://github.com/adobe-photoshop/spaces-design","homepage":"http://adobe-photoshop.github.io/","size":15906,"stargazers_count":592,"watchers_count":592,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":150,"forks":41,"open_issues":150,"watchers":592,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/adobe-photoshop/spaces-design/pulls/1855"},"html":{"href":"https://github.com/adobe-photoshop/spaces-design/pull/1855"},"issue":{"href":"https://api.github.com/repos/adobe-photoshop/spaces-design/issues/1855"},"comments":{"href":"https://api.github.com/repos/adobe-photoshop/spaces-design/issues/1855/comments"},"review_comments":{"href":"https://api.github.com/repos/adobe-photoshop/spaces-design/pulls/1855/comments"},"review_comment":{"href":"https://api.github.com/repos/adobe-photoshop/spaces-design/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/adobe-photoshop/spaces-design/pulls/1855/commits"},"statuses":{"href":"https://api.github.com/repos/adobe-photoshop/spaces-design/statuses/8bace5b263f5fc0a33bf40236e52d308d9f43b5e"}}}}