mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-15 12:15:20 +08:00
ccbf04cb67
Fixed languages popup Release commit
42 lines
No EOL
1.1 KiB
JavaScript
42 lines
No EOL
1.1 KiB
JavaScript
|
|
(function (module, require) {
|
|
|
|
'use strict';
|
|
|
|
var
|
|
ko = require('ko'),
|
|
|
|
Enums = require('Enums'),
|
|
Utils = require('Utils')
|
|
;
|
|
|
|
/**
|
|
* @constructor
|
|
* @param {number=} iType = Enums.ContactPropertyType.Unknown
|
|
* @param {string=} sTypeStr = ''
|
|
* @param {string=} sValue = ''
|
|
* @param {boolean=} bFocused = false
|
|
* @param {string=} sPlaceholder = ''
|
|
*/
|
|
function ContactPropertyModel(iType, sTypeStr, sValue, bFocused, sPlaceholder)
|
|
{
|
|
this.type = ko.observable(Utils.isUnd(iType) ? Enums.ContactPropertyType.Unknown : iType);
|
|
this.typeStr = ko.observable(Utils.isUnd(sTypeStr) ? '' : sTypeStr);
|
|
this.focused = ko.observable(Utils.isUnd(bFocused) ? false : !!bFocused);
|
|
this.value = ko.observable(Utils.pString(sValue));
|
|
|
|
this.placeholder = ko.observable(sPlaceholder || '');
|
|
|
|
this.placeholderValue = ko.computed(function () {
|
|
var sPlaceholder = this.placeholder();
|
|
return sPlaceholder ? Utils.i18n(sPlaceholder) : '';
|
|
}, this);
|
|
|
|
this.largeValue = ko.computed(function () {
|
|
return Enums.ContactPropertyType.Note === this.type();
|
|
}, this);
|
|
}
|
|
|
|
module.exports = ContactPropertyModel;
|
|
|
|
}(module, require)); |