| Total Complexity | 7 |
| Complexity/F | 1 |
| Lines of Code | 44 |
| Function Count | 7 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | /* |
||
| 10 | define([ |
||
|
|
|||
| 11 | 'underscore', |
||
| 12 | 'jquery', |
||
| 13 | 'services/sulucomment/comment-manager', |
||
| 14 | 'text!/admin/comments/comment-template/details.html' |
||
| 15 | ], function(_, $, CommentManager, form) { |
||
| 16 | |||
| 17 | return { |
||
| 18 | |||
| 19 | defaults: { |
||
| 20 | templates: { |
||
| 21 | form: form |
||
| 22 | }, |
||
| 23 | translations: { |
||
| 24 | title: 'public.title', |
||
| 25 | message: 'sulu_comment.list.message' |
||
| 26 | } |
||
| 27 | }, |
||
| 28 | |||
| 29 | type: 'form-tab', |
||
| 30 | |||
| 31 | tabInitialize: function() { |
||
| 32 | this.sandbox.on('sulu.content.changed', this.setDirty.bind(this)); |
||
| 33 | }, |
||
| 34 | |||
| 35 | parseData: function(data) { |
||
| 36 | return data; |
||
| 37 | }, |
||
| 38 | |||
| 39 | save: function(data) { |
||
| 40 | CommentManager.save(data).then(function(data) { |
||
| 41 | this.saved(data); |
||
| 42 | }.bind(this)); |
||
| 43 | }, |
||
| 44 | |||
| 45 | getTemplate: function() { |
||
| 46 | return this.templates.form({translations: this.translations, translate: this.sandbox.translate}); |
||
| 47 | }, |
||
| 48 | |||
| 49 | getFormId: function() { |
||
| 50 | return '#comment-form'; |
||
| 51 | } |
||
| 52 | }; |
||
| 53 | }); |
||
| 54 |