| Conditions | 1 |
| Paths | 1 |
| Total Lines | 43 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | /** |
||
| 4 | module.exports = function(GedcomX){ |
||
| 5 | |||
| 6 | // Extend serialization properties |
||
| 7 | GedcomX.PlaceDescription.jsonProps.push('display'); |
||
| 8 | |||
| 9 | // Override init() so that we can deserialize normalized values |
||
| 10 | var oldInit = GedcomX.PlaceDescription.prototype.init; |
||
| 11 | GedcomX.PlaceDescription.prototype.init = function(json){ |
||
| 12 | oldInit.call(this, json); |
||
| 13 | if(json){ |
||
| 14 | this.setDisplay(json.display); |
||
| 15 | } |
||
| 16 | }; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Set the display properties |
||
| 20 | * |
||
| 21 | * @function setDisplay |
||
| 22 | * @instance |
||
| 23 | * @memberof PlaceDescription |
||
| 24 | * @param {PlaceDisplayProperties} display |
||
| 25 | * @return {PlaceDescription} this |
||
| 26 | */ |
||
| 27 | GedcomX.PlaceDescription.prototype.setDisplay = function(display){ |
||
| 28 | if(display){ |
||
| 29 | this.display = GedcomX.PlaceDisplayProperties(display); |
||
| 30 | } |
||
| 31 | return this; |
||
| 32 | }; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Get the display properties |
||
| 36 | * |
||
| 37 | * @function getDisplay |
||
| 38 | * @instance |
||
| 39 | * @memberof PlaceDescription |
||
| 40 | * @return {PlaceDisplayProperties} |
||
| 41 | */ |
||
| 42 | GedcomX.PlaceDescription.prototype.getDisplay = function(){ |
||
| 43 | return this.display; |
||
| 44 | }; |
||
| 45 | |||
| 46 | }; |