Guest User

Untitled

a guest
Oct 19th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. // Bind Firebase data events
  2. _bindDataEvents: function() {
  3. var self = this;
  4.  
  5. this._resources.on('child_added', function(resourceSnapshot) {
  6. $(document).trigger('resource.oneAdded', resourceSnapshot.val());
  7. });
  8.  
  9. this._resources.on('child_changed', function(resourceSnapshot) {
  10. var resource = resourceSnapshot.val();
  11. var el = $('#resources a[data-resourcetag="' + resource.tag + '"]');
  12. if(el.length) {
  13. self._updateResourceElement(resource, el);
  14. }
  15. });
  16. },
Add Comment
Please, Sign In to add comment