Interface optimizations

moment js update
This commit is contained in:
RainLoop Team 2014-04-30 20:24:45 +04:00
parent be8c186f87
commit f36cb72b82
104 changed files with 5869 additions and 1180 deletions

View file

@ -54,6 +54,10 @@ function PopupsContactsViewModel()
return Enums.ContactPropertyType.Email === oProperty.type();
});
this.viewPropertiesWeb = this.viewProperties.filter(function(oProperty) {
return Enums.ContactPropertyType.Web === oProperty.type();
});
this.viewHasNonEmptyRequaredProperties = ko.computed(function() {
var
@ -85,6 +89,11 @@ function PopupsContactsViewModel()
return '' === Utils.trim(oProperty.value()) && !bF;
});
this.viewPropertiesWebEmptyAndOnFocused = this.viewPropertiesWeb.filter(function(oProperty) {
var bF = oProperty.focused();
return '' === Utils.trim(oProperty.value()) && !bF;
});
this.viewPropertiesEmailsEmptyAndOnFocused.subscribe(function(aList) {
fFastClearEmptyListHelper(aList);
});
@ -93,6 +102,10 @@ function PopupsContactsViewModel()
fFastClearEmptyListHelper(aList);
});
this.viewPropertiesWebEmptyAndOnFocused.subscribe(function(aList) {
fFastClearEmptyListHelper(aList);
});
this.viewSaving = ko.observable(false);
this.useCheckboxesInList = RL.data().useCheckboxesInList;
@ -318,6 +331,11 @@ PopupsContactsViewModel.prototype.addNewPhone = function ()
this.addNewProperty(Enums.ContactPropertyType.Phone, 'Mobile');
};
PopupsContactsViewModel.prototype.addNewWeb = function ()
{
this.addNewProperty(Enums.ContactPropertyType.Web);
};
PopupsContactsViewModel.prototype.exportVcf = function ()
{
RL.download(RL.link().exportContactsVcf());
@ -489,8 +507,8 @@ PopupsContactsViewModel.prototype.populateViewContact = function (oContact)
this.viewReadOnly(!!oContact.readOnly);
}
aList.unshift(new ContactPropertyModel(Enums.ContactPropertyType.LastName, '', sLastName, !oContact, 'CONTACTS/PLACEHOLDER_ENTER_LAST_NAME'));
aList.unshift(new ContactPropertyModel(Enums.ContactPropertyType.FirstName, '', sFirstName, false, 'CONTACTS/PLACEHOLDER_ENTER_FIRST_NAME'));
aList.unshift(new ContactPropertyModel(Enums.ContactPropertyType.LastName, '', sLastName, false, 'CONTACTS/PLACEHOLDER_ENTER_LAST_NAME'));
aList.unshift(new ContactPropertyModel(Enums.ContactPropertyType.FirstName, '', sFirstName, !oContact, 'CONTACTS/PLACEHOLDER_ENTER_FIRST_NAME'));
this.viewID(sId);
this.viewProperties([]);