Skip to content

Commit

Permalink
Merge branch 'xtuple'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikerodonnell89 committed Apr 1, 2013
2 parents 8f81ec4 + cc62984 commit 3608b09
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion enyo-client/database/resetdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

try:
print "Dropping database", args.H, args.d, "if it exists"
subprocess.call(['dropdb', '-h', args.H, args.d], stdout=out, stderr=out)
subprocess.call(['dropdb', '-U', args.u, '-h', args.H, args.d], stdout=out, stderr=out)
print "Creating database", args.d
subprocess.call(['createdb', '-U', args.u, '-h', args.H, '-T', 'template1', args.d], stdout=out, stderr=out)
print "Restoring from backup file", args.b
Expand Down
3 changes: 2 additions & 1 deletion lib/backbone-x/source/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ white:true*/
this.on('change', this.didChange);
this.on('error', this.didError);
this.on('destroy', this.didDestroy);
this.on('change:lock', this.lockDidChange);
this.on('change:lock', this.lockDidChangeTest);
for (i = 0; i < relations.length; i++) {
if (relations[i].type === Backbone.HasMany &&
relations[i].includeInJSON === true) {
Expand Down Expand Up @@ -150,6 +150,7 @@ white:true*/
options.propagate = true; // Update status of *all* relations
options.success = function (resp) {
model.setStatus(K.READY_CLEAN, options);
model.lockDidChange(model, model.get("lock"));
if (XT.debugging) {
XT.log('Fetch successful');
}
Expand Down
8 changes: 7 additions & 1 deletion lib/backbone-x/source/model_mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,14 @@ white:true*/
this.on('change', this.didChange);
this.on('error', this.didError);
this.on('destroy', this.didDestroy);
this.on('change:lock', this.lockDidChange);
this.on('change:lock', this.lockDidChangeTest);
this._eventsBound = true;
},

lockDidChangeTest: function () {
console.log("I'm predicting that this won't ever happen: lockDidChangeTest");
},

/**
Returns whether the current record can be updated based on privilege
settings.
Expand Down Expand Up @@ -339,6 +343,8 @@ white:true*/
}, 25 * 1000);

}

this.trigger("lockChange"); // for the view
},

/*
Expand Down
8 changes: 4 additions & 4 deletions lib/enyo-x/source/views/workspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ trailing:true white:true*/
// Clean up
if (this.value) {
this.value.off("change", this.attributesChanged, this);
this.value.off("change:lock", this.lockChanged, this);
this.value.off("lockChange", this.lockChanged, this);
this.value.off("readOnlyChange", this.attributesChanged, this);
this.value.off("statusChange", this.statusChanged, this);
this.value.off("invalid", this.error, this);
Expand All @@ -313,7 +313,7 @@ trailing:true white:true*/
// Create new instance and bindings
this.value = new Klass();
this.value.on("change", this.attributesChanged, this);
this.value.on("change:lock", this.lockChanged, this);
this.value.on("lockChange", this.lockChanged, this);
this.value.on("readOnlyChange", this.attributesChanged, this);
this.value.on("statusChange", this.statusChanged, this);
this.value.on("invalid", this.error, this);
Expand Down Expand Up @@ -445,13 +445,13 @@ trailing:true white:true*/
changes[attrs[i]] = true;
}
options.changes = changes;

// Update header if applicable
if (model.isReady()) {
this.headerValuesChanged();
this.attributesChanged(model, options);
}

this.doStatusChange(inEvent);
},
/**
Expand Down

0 comments on commit 3608b09

Please sign in to comment.