Browse Source

Improve contactsUpdate, update placeholder text, and required angular.

pull/104/head
Evan Theurer 11 years ago
parent
commit
db9caeec92
  1. 11
      static/js/controllers/contactsmanagercontroller.js
  2. 2
      static/js/services/buddylist.js
  3. 2
      static/partials/contactsmanageredit.html

11
static/js/controllers/contactsmanagercontroller.js

@ -37,24 +37,17 @@ define([], function() { @@ -37,24 +37,17 @@ define([], function() {
);
};
var updateContacts = function(async) {
if (async) {
$scope.$apply(function(scope) {
var updateContacts = function() {
$scope.contacts = contactData.getAll();
});
} else {
$scope.contacts = contactData.getAll();
}
};
updateContacts();
contacts.e.on('contactadded', function() {
updateContacts(true);
updateContacts();
});
contacts.e.on('contactupdated', function() {
updateContacts();
});
contacts.e.on('contactremoved', function() {
// Don't call updateContacts with async true: $modalInstance.$close() is called right before, triggering a $digest.
updateContacts();
});

2
static/js/services/buddylist.js

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
define(['underscore', 'modernizr', 'avltree', 'text!partials/buddy.html', 'text!partials/buddyactions.html', 'text!partials/buddyactionsforaudiomixer.html'], function(_, Modernizr, AvlTree, templateBuddy, templateBuddyActions, templateBuddyActionsForAudioMixer) {
define(['angular', 'underscore', 'modernizr', 'avltree', 'text!partials/buddy.html', 'text!partials/buddyactions.html', 'text!partials/buddyactionsforaudiomixer.html'], function(angular, _, Modernizr, AvlTree, templateBuddy, templateBuddyActions, templateBuddyActionsForAudioMixer) {
var BuddyTree = function() {

2
static/partials/contactsmanageredit.html

@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
<div class="form-group">
<label for="contact-name" class="col-xs-4 control-label">{{_('Name')}}</label>
<div class="col-xs-6">
<input id="contact-name" class="form-control" type="text" placeholder="{{_('Unnamed')}}" ng-model="contact.Status.displayName">
<input id="contact-name" class="form-control" type="text" placeholder="{{_('Contact alias')}}" ng-model="contact.Status.displayName">
</div>
</div>
<div class="form-group" ng-if="buddySyncable">

Loading…
Cancel
Save