Guest User

Untitled

a guest
Jul 20th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. Prefs.prototype.refreshPrefs = function(success, failure) {
  2. this.success = success;
  3. this.failure = failure;
  4. Depot = new Mojo.Depot( { name: PREF_FILE}, this.depotConnectSuccess, this.depotConnectFailure);
  5. }
  6.  
  7. Prefs.prototype.depotConnectSuccess = function() {
  8. //if we connected successfully, try and load our data
  9. Mojo.Log.info("connected, trying to get values" + this);
  10. Mojo.Log.info("callbacks " + this + this.getPrefsSuccess + this.getPrefsFailure);
  11. Depot.get("prefs", this.getPrefsSuccess, this.getPrefsFailure);
  12. }
  13.  
  14. Prefs.prototype.getPrefsSuccess = function(prefs) {
  15. }
  16.  
  17. Prefs.prototype.getPrefsFailure = function(prefs) {
  18. }
  19.  
  20. ## what I run in my assistant:
  21.  
  22. this.myPrefs = new Prefs();
  23. Mojo.Log.info("prefs" + this.myPrefs + this);
  24. this.myPrefs.refreshPrefs(this.handleRefreshPrefs, this.handleFailedPrefs);
  25.  
  26. ## output
  27. # Info: prefs[object Object][object Object]
  28. # Info: connected, trying to get values[object global]
  29. # Info: callbacks [object global]undefinedundefined
Add Comment
Please, Sign In to add comment