{"action":"created","issue":{"url":"https://api.github.com/repos/angular-gantt/angular-gantt/issues/591","repository_url":"https://api.github.com/repos/angular-gantt/angular-gantt","labels_url":"https://api.github.com/repos/angular-gantt/angular-gantt/issues/591/labels{/name}","comments_url":"https://api.github.com/repos/angular-gantt/angular-gantt/issues/591/comments","events_url":"https://api.github.com/repos/angular-gantt/angular-gantt/issues/591/events","html_url":"https://github.com/angular-gantt/angular-gantt/issues/591","id":136223223,"number":591,"title":"Disabling creation of new dependencies","user":{"login":"rschenkel","id":4661810,"avatar_url":"https://avatars.githubusercontent.com/u/4661810?v=3","gravatar_id":"","url":"https://api.github.com/users/rschenkel","html_url":"https://github.com/rschenkel","followers_url":"https://api.github.com/users/rschenkel/followers","following_url":"https://api.github.com/users/rschenkel/following{/other_user}","gists_url":"https://api.github.com/users/rschenkel/gists{/gist_id}","starred_url":"https://api.github.com/users/rschenkel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rschenkel/subscriptions","organizations_url":"https://api.github.com/users/rschenkel/orgs","repos_url":"https://api.github.com/users/rschenkel/repos","events_url":"https://api.github.com/users/rschenkel/events{/privacy}","received_events_url":"https://api.github.com/users/rschenkel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-24T23:30:56Z","updated_at":"2016-02-28T18:27:16Z","closed_at":null,"body":"Is it possible to use the dependency plugin to show existing dependencies but disable the ability to create new dependencies using endpoints and drag and drop?\r\n"},"comment":{"url":"https://api.github.com/repos/angular-gantt/angular-gantt/issues/comments/189917712","html_url":"https://github.com/angular-gantt/angular-gantt/issues/591#issuecomment-189917712","issue_url":"https://api.github.com/repos/angular-gantt/angular-gantt/issues/591","id":189917712,"user":{"login":"rschenkel","id":4661810,"avatar_url":"https://avatars.githubusercontent.com/u/4661810?v=3","gravatar_id":"","url":"https://api.github.com/users/rschenkel","html_url":"https://github.com/rschenkel","followers_url":"https://api.github.com/users/rschenkel/followers","following_url":"https://api.github.com/users/rschenkel/following{/other_user}","gists_url":"https://api.github.com/users/rschenkel/gists{/gist_id}","starred_url":"https://api.github.com/users/rschenkel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rschenkel/subscriptions","organizations_url":"https://api.github.com/users/rschenkel/orgs","repos_url":"https://api.github.com/users/rschenkel/repos","events_url":"https://api.github.com/users/rschenkel/events{/privacy}","received_events_url":"https://api.github.com/users/rschenkel/received_events","type":"User","site_admin":false},"created_at":"2016-02-28T18:27:16Z","updated_at":"2016-02-28T18:27:16Z","body":"I tried to push a branch with a suggested fix however I was unsuccessful... so here is the code:\r\n\r\nIn dependenies.js:\r\n\r\n    angular.module('gantt.dependencies', ['gantt', 'gantt.dependencies.templates']).directive('ganttDependencies', ['$timeout', '$document', 'ganttDebounce', 'GanttDependenciesManager', function($timeout, $document, debounce, DependenciesManager) {\r\n        return {\r\n            restrict: 'E',\r\n            require: '^gantt',\r\n            scope: {\r\n                enabled: '=?',\r\n                readOnly: '=?', // New code\r\n                jsPlumbDefaults: '=?',\r\n                endpoints: '=?',\r\n                fallbackEndpoints: '=?'\r\n            },\r\n            link: function(scope, element, attrs, ganttCtrl) {\r\n                var api = ganttCtrl.gantt.api;\r\n\r\n                // Load options from global options attribute.\r\n                if (scope.options && typeof(scope.options.dependencies) === 'object') {\r\n                    for (var option in scope.options.dependencies) {\r\n                        scope[option] = scope.options[option];\r\n                    }\r\n                }\r\n\r\n                if (scope.enabled === undefined) {\r\n                    scope.enabled = true;\r\n                }\r\n\r\n                // Start of new Code\r\n                if (scope.readOnly === undefined) {\r\n                  scope.readOnly = false;\r\n                }\r\n                // End of new Code\r\n\r\nIn dependenciesManager.factory.js:\r\n\r\n            this.pluginScope.$watch('enabled', function(newValue, oldValue) {\r\n                if (newValue !== oldValue) {\r\n                    self.refresh();\r\n                }\r\n\r\n            });\r\n\r\n            // Start of new Code\r\n            this.pluginScope.$watch('readOnly', function (newValue, oldValue) {\r\n              if (newValue !== oldValue) {\r\n                self.plumb.selectEndpoints().setEnabled(!newValue);\r\n              }\r\n            }, true);\r\n            // End of new Code\r\n\r\n            this.pluginScope.$watch('jsPlumbDefaults', function(newValue, oldValue) {\r\n                if (newValue !== oldValue) {\r\n                    self.plumb.importDefaults(newValue);\r\n                    self.refresh();\r\n                }\r\n            }, true);"}}