2013-12-07 05:50:19 +08:00
|
|
|
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {number=} iType = Enums.ContactPropertyType.Unknown
|
|
|
|
* @param {string=} sValue = ''
|
2013-12-15 19:02:50 +08:00
|
|
|
* @param {boolean=} bFocused = false
|
2013-12-19 08:53:42 +08:00
|
|
|
* @param {string=} sPlaceholder = ''
|
2013-12-07 05:50:19 +08:00
|
|
|
*
|
|
|
|
* @constructor
|
|
|
|
*/
|
2013-12-19 08:53:42 +08:00
|
|
|
function ContactPropertyModel(iType, sValue, bFocused, sPlaceholder)
|
2013-12-07 05:50:19 +08:00
|
|
|
{
|
|
|
|
this.type = ko.observable(Utils.isUnd(iType) ? Enums.ContactPropertyType.Unknown : iType);
|
2013-12-15 19:02:50 +08:00
|
|
|
this.focused = ko.observable(Utils.isUnd(bFocused) ? false : !!bFocused);
|
2013-12-07 05:50:19 +08:00
|
|
|
this.value = ko.observable(Utils.pString(sValue));
|
2013-12-19 08:53:42 +08:00
|
|
|
|
|
|
|
this.placeholder = ko.observable(sPlaceholder || '');
|
|
|
|
|
|
|
|
this.placeholderValue = ko.computed(function () {
|
|
|
|
var sPlaceholder = this.placeholder();
|
|
|
|
return sPlaceholder ? Utils.i18n(sPlaceholder) : '';
|
|
|
|
}, this);
|
2013-12-07 05:50:19 +08:00
|
|
|
}
|