DriveLibrary.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /**
  2. * Copyright (c) 2006-2017, JGraph Ltd
  3. * Copyright (c) 2006-2017, Gaudenz Alder
  4. */
  5. DriveLibrary = function(ui, data, desc)
  6. {
  7. DriveFile.call(this, ui, data);
  8. this.desc = desc;
  9. };
  10. //Extends mxEventSource
  11. mxUtils.extend(DriveLibrary, DriveFile);
  12. /**
  13. * Translates this point by the given vector.
  14. *
  15. * @param {number} dx X-coordinate of the translation.
  16. * @param {number} dy Y-coordinate of the translation.
  17. */
  18. DriveLibrary.prototype.isAutosave = function()
  19. {
  20. return true;
  21. };
  22. /**
  23. * Translates this point by the given vector.
  24. *
  25. * @param {number} dx X-coordinate of the translation.
  26. * @param {number} dy Y-coordinate of the translation.
  27. */
  28. DriveLibrary.prototype.save = function(revision, success, error)
  29. {
  30. this.ui.drive.saveFile(this, revision, mxUtils.bind(this, function(resp)
  31. {
  32. this.desc = resp;
  33. if (success != null)
  34. {
  35. success(resp);
  36. }
  37. }), error);
  38. };
  39. /**
  40. * Returns the location as a new object.
  41. * @type mx.Point
  42. */
  43. DriveLibrary.prototype.open = function()
  44. {
  45. // Do nothing - this should never be called
  46. };