Browse Source

Improve contactsUpdate, update placeholder text, and required angular.

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

13
static/js/controllers/contactsmanagercontroller.js

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

2
static/js/services/buddylist.js

@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * 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() { var BuddyTree = function() {

2
static/partials/contactsmanageredit.html

@ -8,7 +8,7 @@
<div class="form-group"> <div class="form-group">
<label for="contact-name" class="col-xs-4 control-label">{{_('Name')}}</label> <label for="contact-name" class="col-xs-4 control-label">{{_('Name')}}</label>
<div class="col-xs-6"> <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> </div>
<div class="form-group" ng-if="buddySyncable"> <div class="form-group" ng-if="buddySyncable">

Loading…
Cancel
Save