{"action":"created","comment":{"url":"https://api.github.com/repos/sulu-io/SuluProductBundle/pulls/comments/28047368","id":28047368,"diff_hunk":"@@ -0,0 +1,365 @@\n+/*\n+ * This file is part of the Sulu CMS.\n+ *\n+ * (c) MASSIVE ART WebServices GmbH\n+ *\n+ * This source file is subject to the MIT license that is bundled\n+ * with this source code in the file LICENSE.\n+ */\n+\n+define([\n+    'config',\n+    'text!suluproduct/components/products/components/attributes/overlay-content.html'\n+], function(Config, OverlayTpl) {\n+    'use strict';\n+\n+    var formSelector = '#product-attributes-form',\n+        productAttributesInstanceName = 'product-attribute-list-toolbar',\n+        datagridInstanceName = 'product-attribute-datagrid',\n+        overlayInstanceName = 'product-attribute-overlay',\n+        selectInstanceName = 'product-attribute-select',\n+        attrId = 1,\n+        maxLengthTitle = 60,\n+\n+        /**\n+         * bind custom events\n+         */\n+        bindCustomEvents = function() {\n+\n+            this.sandbox.on('sulu.header.back', function() {\n+                this.sandbox.emit('sulu.products.list');\n+            }, this);\n+\n+            this.sandbox.on('sulu.products.saved', function(data) {\n+\n+                var attributes = data.attributes;\n+\n+                // Select action\n+                if (data.action === 1) {\n+                    // ADD RECORD IN DATAGRID\n+                    var result = _.findWhere(attributes, {'attributeId': data.attrId});\n+                    this.sandbox.emit('husky.datagrid.' + datagridInstanceName + '.record.add', {\n+                        id: result.id,\n+                        attributeId: result.attributeId,\n+                        value: result.value,\n+                        attributeName: result.attributeName\n+                    });\n+                    this.sendData.add = false;\n+                } else if (data.action === 2) {\n+                    // DELETE RECORDs IN DATAGRID\n+                    $.each(data.deleteIds, function(key, id) {\n+                        this.sandbox.emit('husky.datagrid.' + datagridInstanceName + '.record.remove', id);\n+                    }.bind(this));\n+                    this.sendData.delete = false;\n+                } else {\n+                    // UPDATE RECORD IN DATAGRID\n+                    this.sandbox.emit('husky.datagrid.' + datagridInstanceName + '.records.change', attributes);\n+                }\n+\n+                setHeaderBar.call(this, true);\n+                this.options.data = data;\n+                this.options.data.status = this.status;\n+            }, this);\n+\n+            this.sandbox.on('husky.overlay' + overlayInstanceName + 'opened', function() {\n+                console.log('husky overlay event opened xasdf');\n+\n+            });\n+\n+        },\n+\n+        /**\n+         * modify header information\n+         */\n+        setHeaderBar = function(saved) {\n+\n+            var type = (!!this.options.data && !!this.options.data.id) ? 'edit' : 'add';\n+            this.sandbox.emit('sulu.header.toolbar.state.change', type, saved, true);\n+\n+        },\n+\n+        /**\n+         * Create overlay content for add attribute overlay\n+         */\n+        createAddOverlayContent = function() {\n+            // create container for overlay\n+            var $overlayContent = this.sandbox.dom.createElement(this.sandbox.util.template(OverlayTpl, {\n+                translate: this.sandbox.translate\n+            }));\n+            this.sandbox.dom.append(this.$el, $overlayContent);\n+\n+            return $overlayContent;\n+","path":"Resources/public/js/components/products/components/attributes/main.js","position":92,"original_position":92,"commit_id":"981b10d21b00d8aaf2f2f1a6f24b7d1b20020a97","original_commit_id":"981b10d21b00d8aaf2f2f1a6f24b7d1b20020a97","user":{"login":"christianbader","id":96615,"avatar_url":"https://avatars.githubusercontent.com/u/96615?v=3","gravatar_id":"","url":"https://api.github.com/users/christianbader","html_url":"https://github.com/christianbader","followers_url":"https://api.github.com/users/christianbader/followers","following_url":"https://api.github.com/users/christianbader/following{/other_user}","gists_url":"https://api.github.com/users/christianbader/gists{/gist_id}","starred_url":"https://api.github.com/users/christianbader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christianbader/subscriptions","organizations_url":"https://api.github.com/users/christianbader/orgs","repos_url":"https://api.github.com/users/christianbader/repos","events_url":"https://api.github.com/users/christianbader/events{/privacy}","received_events_url":"https://api.github.com/users/christianbader/received_events","type":"User","site_admin":false},"body":"remove empty line","created_at":"2015-04-09T09:28:59Z","updated_at":"2015-04-09T09:28:59Z","html_url":"https://github.com/sulu-io/SuluProductBundle/pull/127#discussion_r28047368","pull_request_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/pulls/127","_links":{"self":{"href":"https://api.github.com/repos/sulu-io/SuluProductBundle/pulls/comments/28047368"},"html":{"href":"https://github.com/sulu-io/SuluProductBundle/pull/127#discussion_r28047368"},"pull_request":{"href":"https://api.github.com/repos/sulu-io/SuluProductBundle/pulls/127"}}},"pull_request":{"url":"https://api.github.com/repos/sulu-io/SuluProductBundle/pulls/127","id":31909471,"html_url":"https://github.com/sulu-io/SuluProductBundle/pull/127","diff_url":"https://github.com/sulu-io/SuluProductBundle/pull/127.diff","patch_url":"https://github.com/sulu-io/SuluProductBundle/pull/127.patch","issue_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/issues/127","number":127,"state":"open","locked":false,"title":"Productattributes","user":{"login":"xandrej","id":4947276,"avatar_url":"https://avatars.githubusercontent.com/u/4947276?v=3","gravatar_id":"","url":"https://api.github.com/users/xandrej","html_url":"https://github.com/xandrej","followers_url":"https://api.github.com/users/xandrej/followers","following_url":"https://api.github.com/users/xandrej/following{/other_user}","gists_url":"https://api.github.com/users/xandrej/gists{/gist_id}","starred_url":"https://api.github.com/users/xandrej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xandrej/subscriptions","organizations_url":"https://api.github.com/users/xandrej/orgs","repos_url":"https://api.github.com/users/xandrej/repos","events_url":"https://api.github.com/users/xandrej/events{/privacy}","received_events_url":"https://api.github.com/users/xandrej/received_events","type":"User","site_admin":false},"body":"__Tasks:__\r\n- [x] done\r\n- [ ] todo \r\n- [ ] got feedback\r\n\r\n| Q            | A\r\n| ------------- | ---\r\n| Bug fix?      | no\r\n| New feature?  | yes\r\n| Tests pass?  | yes\r\n| Fixed tickets | https://github.com/massiveart/POOL-ALPIN/issues/800\r\n| Doc          | none","created_at":"2015-03-25T10:30:40Z","updated_at":"2015-04-09T09:28:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"852d0ecc23324e4b7e1b318b666a3c262c454b27","assignee":{"login":"xandrej","id":4947276,"avatar_url":"https://avatars.githubusercontent.com/u/4947276?v=3","gravatar_id":"","url":"https://api.github.com/users/xandrej","html_url":"https://github.com/xandrej","followers_url":"https://api.github.com/users/xandrej/followers","following_url":"https://api.github.com/users/xandrej/following{/other_user}","gists_url":"https://api.github.com/users/xandrej/gists{/gist_id}","starred_url":"https://api.github.com/users/xandrej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xandrej/subscriptions","organizations_url":"https://api.github.com/users/xandrej/orgs","repos_url":"https://api.github.com/users/xandrej/repos","events_url":"https://api.github.com/users/xandrej/events{/privacy}","received_events_url":"https://api.github.com/users/xandrej/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/pulls/127/commits","review_comments_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/pulls/127/comments","review_comment_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/issues/127/comments","statuses_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/statuses/981b10d21b00d8aaf2f2f1a6f24b7d1b20020a97","head":{"label":"sulu-io:productattributes","ref":"productattributes","sha":"981b10d21b00d8aaf2f2f1a6f24b7d1b20020a97","user":{"login":"sulu-io","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=3","gravatar_id":"","url":"https://api.github.com/users/sulu-io","html_url":"https://github.com/sulu-io","followers_url":"https://api.github.com/users/sulu-io/followers","following_url":"https://api.github.com/users/sulu-io/following{/other_user}","gists_url":"https://api.github.com/users/sulu-io/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu-io/subscriptions","organizations_url":"https://api.github.com/users/sulu-io/orgs","repos_url":"https://api.github.com/users/sulu-io/repos","events_url":"https://api.github.com/users/sulu-io/events{/privacy}","received_events_url":"https://api.github.com/users/sulu-io/received_events","type":"Organization","site_admin":false},"repo":{"id":17173120,"name":"SuluProductBundle","full_name":"sulu-io/SuluProductBundle","owner":{"login":"sulu-io","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=3","gravatar_id":"","url":"https://api.github.com/users/sulu-io","html_url":"https://github.com/sulu-io","followers_url":"https://api.github.com/users/sulu-io/followers","following_url":"https://api.github.com/users/sulu-io/following{/other_user}","gists_url":"https://api.github.com/users/sulu-io/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu-io/subscriptions","organizations_url":"https://api.github.com/users/sulu-io/orgs","repos_url":"https://api.github.com/users/sulu-io/repos","events_url":"https://api.github.com/users/sulu-io/events{/privacy}","received_events_url":"https://api.github.com/users/sulu-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sulu-io/SuluProductBundle","description":"","fork":false,"url":"https://api.github.com/repos/sulu-io/SuluProductBundle","forks_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/forks","keys_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/teams","hooks_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/hooks","issue_events_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/issues/events{/number}","events_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/events","assignees_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/assignees{/user}","branches_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/branches{/branch}","tags_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/tags","blobs_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/languages","stargazers_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/stargazers","contributors_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/contributors","subscribers_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/subscribers","subscription_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/subscription","commits_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/contents/{+path}","compare_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/merges","archive_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/downloads","issues_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/issues{/number}","pulls_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/labels{/name}","releases_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/releases{/id}","created_at":"2014-02-25T13:03:06Z","updated_at":"2015-03-27T10:21:47Z","pushed_at":"2015-04-08T14:48:03Z","git_url":"git://github.com/sulu-io/SuluProductBundle.git","ssh_url":"git@github.com:sulu-io/SuluProductBundle.git","clone_url":"https://github.com/sulu-io/SuluProductBundle.git","svn_url":"https://github.com/sulu-io/SuluProductBundle","homepage":null,"size":2984,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":15,"forks":0,"open_issues":15,"watchers":1,"default_branch":"develop"}},"base":{"label":"sulu-io:develop","ref":"develop","sha":"fb14103e16cee6fefe78068eb02e1c41138cd9a5","user":{"login":"sulu-io","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=3","gravatar_id":"","url":"https://api.github.com/users/sulu-io","html_url":"https://github.com/sulu-io","followers_url":"https://api.github.com/users/sulu-io/followers","following_url":"https://api.github.com/users/sulu-io/following{/other_user}","gists_url":"https://api.github.com/users/sulu-io/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu-io/subscriptions","organizations_url":"https://api.github.com/users/sulu-io/orgs","repos_url":"https://api.github.com/users/sulu-io/repos","events_url":"https://api.github.com/users/sulu-io/events{/privacy}","received_events_url":"https://api.github.com/users/sulu-io/received_events","type":"Organization","site_admin":false},"repo":{"id":17173120,"name":"SuluProductBundle","full_name":"sulu-io/SuluProductBundle","owner":{"login":"sulu-io","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=3","gravatar_id":"","url":"https://api.github.com/users/sulu-io","html_url":"https://github.com/sulu-io","followers_url":"https://api.github.com/users/sulu-io/followers","following_url":"https://api.github.com/users/sulu-io/following{/other_user}","gists_url":"https://api.github.com/users/sulu-io/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu-io/subscriptions","organizations_url":"https://api.github.com/users/sulu-io/orgs","repos_url":"https://api.github.com/users/sulu-io/repos","events_url":"https://api.github.com/users/sulu-io/events{/privacy}","received_events_url":"https://api.github.com/users/sulu-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sulu-io/SuluProductBundle","description":"","fork":false,"url":"https://api.github.com/repos/sulu-io/SuluProductBundle","forks_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/forks","keys_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/teams","hooks_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/hooks","issue_events_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/issues/events{/number}","events_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/events","assignees_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/assignees{/user}","branches_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/branches{/branch}","tags_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/tags","blobs_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/languages","stargazers_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/stargazers","contributors_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/contributors","subscribers_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/subscribers","subscription_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/subscription","commits_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/contents/{+path}","compare_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/merges","archive_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/downloads","issues_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/issues{/number}","pulls_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/labels{/name}","releases_url":"https://api.github.com/repos/sulu-io/SuluProductBundle/releases{/id}","created_at":"2014-02-25T13:03:06Z","updated_at":"2015-03-27T10:21:47Z","pushed_at":"2015-04-08T14:48:03Z","git_url":"git://github.com/sulu-io/SuluProductBundle.git","ssh_url":"git@github.com:sulu-io/SuluProductBundle.git","clone_url":"https://github.com/sulu-io/SuluProductBundle.git","svn_url":"https://github.com/sulu-io/SuluProductBundle","homepage":null,"size":2984,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":15,"forks":0,"open_issues":15,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/sulu-io/SuluProductBundle/pulls/127"},"html":{"href":"https://github.com/sulu-io/SuluProductBundle/pull/127"},"issue":{"href":"https://api.github.com/repos/sulu-io/SuluProductBundle/issues/127"},"comments":{"href":"https://api.github.com/repos/sulu-io/SuluProductBundle/issues/127/comments"},"review_comments":{"href":"https://api.github.com/repos/sulu-io/SuluProductBundle/pulls/127/comments"},"review_comment":{"href":"https://api.github.com/repos/sulu-io/SuluProductBundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sulu-io/SuluProductBundle/pulls/127/commits"},"statuses":{"href":"https://api.github.com/repos/sulu-io/SuluProductBundle/statuses/981b10d21b00d8aaf2f2f1a6f24b7d1b20020a97"}}}}