Guest User

Untitled

a guest
May 25th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. // Added a new edit function, this will eventually replace the other one.
  2. whitepages.address_book.ChangeSet.prototype.simpleEditNew = function(element, oldValue, newValue) {
  3. console.log("NEW simple edit called");
  4. console.trace();
  5. var xpath = element.attr('data-path');
  6. var object_id = element.attr('data-field-id');
  7. var field_name = element.attr('data-field');
  8.  
  9. if (object_id !== undefined && object_id.length > 0) {
  10. xpath += "[@id='" + object_id + "']";
  11. }
  12.  
  13. this.changeset.push({
  14. command: 'update',
  15. xpath: xpath,
  16. field: field_name,
  17. old_val: oldValue,
  18. new_val: newValue
  19. });
  20. };
Add Comment
Please, Sign In to add comment