{"action":"created","comment":{"url":"https://api.github.com/repos/adobe-photoshop/spaces-design/pulls/comments/33386715","id":33386715,"diff_hunk":"@@ -379,54 +417,47 @@ define(function (require, exports, module) {\n                 layerCount = null;\n                 childComponents = null;\n             } else {\n-                layerComponents = doc.layers.top\n-                    .map(function (layer) {\n-                        // If the layer or its descendants is not the dropTarget, pass false here\n-                        // I am attempting to not have so many extra renders of the Layers...but this may be slower\n-                        // Otherwise, pass down the layer\n-\n-                        var dragTarget = this.props.dragTarget;\n-\n-                        var shouldPassDropTarget = !!(layer &&\n-                                this.props.dropTarget &&\n-                                doc.layers.descendants(layer).indexOf(this.props.dropTarget.keyObject) !== -1),\n-                            shouldPassDragTarget = false;\n-\n-                        if (dragTarget) {\n-                            // Should be false if the layer and the layers children do not appear in this list\n-                            shouldPassDragTarget = dragTarget.some(function (dragT) {\n-                                return layer && doc.layers.descendants(layer).indexOf(dragT) !== -1;\n-                            });\n-                        } else if (this.state.futureReorder) {\n+                layerComponents = doc.layers.allVisibleReversed\n+                    .map(function (layer, visibleIndex) {\n+                        var dragTarget = this.props.dragTarget,\n+                            dropTarget = this.props.dropTarget;\n+\n+                        if (this.state.futureReorder) {\n                             dragTarget = this.props.pastDragTarget;\n-                            shouldPassDragTarget = dragTarget.some(function (dragT) {\n-                                return layer && doc.layers.descendants(layer).indexOf(dragT) !== -1;\n-                            });\n                         }\n+                        var isDragTarget = !!(dragTarget && dragTarget.indexOf(layer) !== -1),\n+                            isDropTarget = !!(dropTarget && dropTarget.keyObject.key === layer.key);\n \n                         return (\n-                            <li key={layer.key}>\n-                                <Layer\n+                                <LayerFace\n+                                    key={layer.key}\n+                                    ref={layer.key}\n                                     disabled={this.props.disabled}\n+                                    registerOnMount={!this.state.batchRegister}\n+                                    deregisterOnUnmount={false}\n                                     document={doc}\n                                     layer={layer}\n                                     axis=\"y\"\n-                                    layerIndex={doc.layers.indexOf(layer)}\n+                                    visibleLayerIndex={visibleIndex}\n                                     dragPlaceholderClass=\"face__placeholder\"\n                                     validateDrop={this._validDropTarget}\n                                     onDragStop={this._handleStop}\n                                     getDragItems={this._getDraggingLayers}\n-                                    dragTarget={shouldPassDragTarget && dragTarget}\n-                                    dragPosition={(shouldPassDropTarget || shouldPassDragTarget) &&\n+                                    dragTarget={isDragTarget}\n+                                    dragPosition={(isDropTarget || isDragTarget) &&\n                                         this.props.dragPosition}\n-                                    dropTarget={shouldPassDropTarget && this.props.dropTarget}\n-                                    dropAbove={shouldPassDropTarget && this.props.dropAbove} />\n-                            </li>\n+                                    dropTarget={isDropTarget}\n+                                    dropAbove={!!(isDropTarget && this.state.dropAbove)} />\n                         );\n                     }, this);\n \n+                var layerListClasses = classnames({\n+                    \"layer-list\": true,\n+                    \"layer-list__dragging\": this.props.dragTarget","path":"src/js/jsx/sections/pages/PagesPanel.jsx","position":279,"original_position":279,"commit_id":"fc41c0e3c2610211b7f90e113daa457e8d1f5ca1","original_commit_id":"fc41c0e3c2610211b7f90e113daa457e8d1f5ca1","user":{"login":"iwehrman","id":1075154,"avatar_url":"https://avatars.githubusercontent.com/u/1075154?v=3","gravatar_id":"","url":"https://api.github.com/users/iwehrman","html_url":"https://github.com/iwehrman","followers_url":"https://api.github.com/users/iwehrman/followers","following_url":"https://api.github.com/users/iwehrman/following{/other_user}","gists_url":"https://api.github.com/users/iwehrman/gists{/gist_id}","starred_url":"https://api.github.com/users/iwehrman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iwehrman/subscriptions","organizations_url":"https://api.github.com/users/iwehrman/orgs","repos_url":"https://api.github.com/users/iwehrman/repos","events_url":"https://api.github.com/users/iwehrman/events{/privacy}","received_events_url":"https://api.github.com/users/iwehrman/received_events","type":"User","site_admin":false},"body":"... and re-used here.","created_at":"2015-06-26T19:16:18Z","updated_at":"2015-06-26T19:16:18Z","html_url":"https://github.com/adobe-photoshop/spaces-design/pull/1625#discussion_r33386715","pull_request_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/pulls/1625","_links":{"self":{"href":"https://api.github.com/repos/adobe-photoshop/spaces-design/pulls/comments/33386715"},"html":{"href":"https://github.com/adobe-photoshop/spaces-design/pull/1625#discussion_r33386715"},"pull_request":{"href":"https://api.github.com/repos/adobe-photoshop/spaces-design/pulls/1625"}}},"pull_request":{"url":"https://api.github.com/repos/adobe-photoshop/spaces-design/pulls/1625","id":38141981,"html_url":"https://github.com/adobe-photoshop/spaces-design/pull/1625","diff_url":"https://github.com/adobe-photoshop/spaces-design/pull/1625.diff","patch_url":"https://github.com/adobe-photoshop/spaces-design/pull/1625.patch","issue_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/issues/1625","number":1625,"state":"open","locked":false,"title":"Flattened layer hierarchy","user":{"login":"designedbyscience","id":22372,"avatar_url":"https://avatars.githubusercontent.com/u/22372?v=3","gravatar_id":"","url":"https://api.github.com/users/designedbyscience","html_url":"https://github.com/designedbyscience","followers_url":"https://api.github.com/users/designedbyscience/followers","following_url":"https://api.github.com/users/designedbyscience/following{/other_user}","gists_url":"https://api.github.com/users/designedbyscience/gists{/gist_id}","starred_url":"https://api.github.com/users/designedbyscience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/designedbyscience/subscriptions","organizations_url":"https://api.github.com/users/designedbyscience/orgs","repos_url":"https://api.github.com/users/designedbyscience/repos","events_url":"https://api.github.com/users/designedbyscience/events{/privacy}","received_events_url":"https://api.github.com/users/designedbyscience/received_events","type":"User","site_admin":false},"body":"Cleaned up a bunch of bugs and CSS related to dragging and dropping, and layer selection in groups\r\n\r\nOn mount of Layers panel, we now batch the registration of the droppables\r\nSimilarly, we also batch deregister layer items when the set changes\r\n\r\nAddresses:\r\n#1579 \r\n#1577\r\n#1574\r\n#1570\r\n#1569\r\n#1568\r\n#1404\r\n#1398 \r\n","created_at":"2015-06-19T19:54:37Z","updated_at":"2015-06-26T19:16:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"df91ccc6cdf2536dc42272d426cb8b61a6cec44f","assignee":{"login":"iwehrman","id":1075154,"avatar_url":"https://avatars.githubusercontent.com/u/1075154?v=3","gravatar_id":"","url":"https://api.github.com/users/iwehrman","html_url":"https://github.com/iwehrman","followers_url":"https://api.github.com/users/iwehrman/followers","following_url":"https://api.github.com/users/iwehrman/following{/other_user}","gists_url":"https://api.github.com/users/iwehrman/gists{/gist_id}","starred_url":"https://api.github.com/users/iwehrman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iwehrman/subscriptions","organizations_url":"https://api.github.com/users/iwehrman/orgs","repos_url":"https://api.github.com/users/iwehrman/repos","events_url":"https://api.github.com/users/iwehrman/events{/privacy}","received_events_url":"https://api.github.com/users/iwehrman/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/pulls/1625/commits","review_comments_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/pulls/1625/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/1625/comments","statuses_url":"https://api.github.com/repos/adobe-photoshop/spaces-design/statuses/fc41c0e3c2610211b7f90e113daa457e8d1f5ca1","head":{"label":"adobe-photoshop:designedbyscience/flatten-layers","ref":"designedbyscience/flatten-layers","sha":"fc41c0e3c2610211b7f90e113daa457e8d1f5ca1","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-06-26T19:10:34Z","pushed_at":"2015-06-26T18:12:22Z","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":14296,"stargazers_count":509,"watchers_count":509,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":145,"forks":28,"open_issues":145,"watchers":509,"default_branch":"master"}},"base":{"label":"adobe-photoshop:master","ref":"master","sha":"d90e0893c4f1a2318f89ac6c21b0b3f4f400643c","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-06-26T19:10:34Z","pushed_at":"2015-06-26T18:12:22Z","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":14296,"stargazers_count":509,"watchers_count":509,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":145,"forks":28,"open_issues":145,"watchers":509,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/adobe-photoshop/spaces-design/pulls/1625"},"html":{"href":"https://github.com/adobe-photoshop/spaces-design/pull/1625"},"issue":{"href":"https://api.github.com/repos/adobe-photoshop/spaces-design/issues/1625"},"comments":{"href":"https://api.github.com/repos/adobe-photoshop/spaces-design/issues/1625/comments"},"review_comments":{"href":"https://api.github.com/repos/adobe-photoshop/spaces-design/pulls/1625/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/1625/commits"},"statuses":{"href":"https://api.github.com/repos/adobe-photoshop/spaces-design/statuses/fc41c0e3c2610211b7f90e113daa457e8d1f5ca1"}}}}