| Total Complexity | 7 |
| Complexity/F | 1.17 |
| Lines of Code | 33 |
| Function Count | 6 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | /* |
||
| 10 | define(['services/husky/util', 'services/husky/mediator'], function(Util, Mediator) { |
||
| 11 | |||
| 12 | 'use strict'; |
||
| 13 | |||
| 14 | var instance = null, |
||
| 15 | |||
| 16 | getInstance = function() { |
||
| 17 | if (instance === null) { |
||
| 18 | instance = new ThreadRouter(); |
||
| 19 | } |
||
| 20 | |||
| 21 | return instance; |
||
| 22 | }, |
||
| 23 | |||
| 24 | navigate = function(route) { |
||
| 25 | Mediator.emit('sulu.router.navigate', route, true, true); |
||
| 26 | }; |
||
| 27 | |||
| 28 | /** @constructor **/ |
||
| 29 | function ThreadRouter() { |
||
| 30 | } |
||
| 31 | |||
| 32 | ThreadRouter.prototype = { |
||
| 33 | toList: function() { |
||
| 34 | navigate('threads'); |
||
| 35 | }, |
||
| 36 | toEdit: function(id, content) { |
||
| 37 | navigate('threads/edit:' + id + '/' + (content || 'details')); |
||
| 38 | } |
||
| 39 | }; |
||
| 40 | |||
| 41 | return getInstance(); |
||
| 42 | }); |
||
| 43 |