aboutsummaryrefslogtreecommitdiff
path: root/node_modules/montage/ui/autocomplete/result-item.reel/result-item.js
blob: 61b71afa4aa2ee2c48527a14e614962d6249ab07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* <copyright>
 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
 (c) Copyright 2011 Motorola Mobility, Inc.  All Rights Reserved.
 </copyright> */
var Montage = require("montage").Montage,
    Component = require("ui/component").Component,
    DynamicText = require("ui/dynamic-text.reel").DynamicText;

exports.ResultItem = Montage.create(DynamicText, {
    
    textPropertyPath: {value: null},
    
    _object: {value: null},
    object: {
        get: function() {
            return this._object;
        },
        set: function(aValue) {
            if(aValue) {
               this._object = aValue;                
            }
            if(this._object) {
                if(this.textPropertyPath) {
                    this.value = this._object[this.textPropertyPath];
                } else {
                    this.value = this._object;
                }
            }
        }
    }

});