author | Josh <jokajak@gmail.com> | 2012-06-16 01:26:30 (UTC) |
---|---|---|
committer | Josh <jokajak@gmail.com> | 2012-06-16 01:26:30 (UTC) |
commit | 36b3236415b856ddd0ad2804e82e410b5240ff4f (patch) (side-by-side diff) | |
tree | f2efea0a967f890ce9235871fd26a96515596bc4 /frontend/beta/js/Clipperz/PM/DataModel | |
parent | 36ff1deefcbbd24aceca97eb39a13f9da4af8ff5 (diff) | |
download | clipperz-36b3236415b856ddd0ad2804e82e410b5240ff4f.zip clipperz-36b3236415b856ddd0ad2804e82e410b5240ff4f.tar.gz clipperz-36b3236415b856ddd0ad2804e82e410b5240ff4f.tar.bz2 |
fix the cancel button for editing cards
The javascript was checking for the parameters assuming the backend
provided version information. The community edition backend does not
supply any versioning information so the javascript checks both
locations
Diffstat (limited to 'frontend/beta/js/Clipperz/PM/DataModel') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/PM/DataModel/Record.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/Record.js b/frontend/beta/js/Clipperz/PM/DataModel/Record.js index ffb45de..9e496de 100644 --- a/frontend/beta/js/Clipperz/PM/DataModel/Record.js +++ b/frontend/beta/js/Clipperz/PM/DataModel/Record.js @@ -271,50 +271,56 @@ Clipperz.PM.DataModel.Record.prototype = MochiKit.Base.update(null, { return result; }, //------------------------------------------------------------------------- 'processData': function(someValues) { //MochiKit.Logging.logDebug(">>> [" + (new Date()).valueOf() + "] Record.processData"); //MochiKit.Logging.logDebug("--- Record.processData: " + Clipperz.Base.serializeJSON(someValues)); if (this.shouldProcessData()) { var currentVersionParameters; console.log("Record.processData", someValues); this.processDataToExtractLegacyValues(someValues['data']); if (typeof(someValues['data']['notes']) != 'undefined') { this.setNotes(someValues['data']['notes']); } if (someValues['data']['currentVersionKey'] != null) { this.setCurrentVersionKey(someValues['data']['currentVersionKey']); } else { this.setCurrentVersionKey(this.key()); } -// currentVersionParameters = someValues['currentVersion']; - currentVersionParameters = someValues['versions'][someValues['currentVersion']]; +// community edition doesn't currently pass version +// information + if (someValues['versions'] == null) { + currentVersionParameters = someValues['currentVersion']; + } else { + currentVersionParameters = someValues['versions'][someValues['currentVersion']]; + } + console.log("Record.processData - this.currentVersionKey()", this.currentVersionKey()); console.log("Record.processData - currentVersionParameters", currentVersionParameters); currentVersionParameters['key'] = this.currentVersionKey(); this.setCurrentVersion(new Clipperz.PM.DataModel.RecordVersion(this, currentVersionParameters)); if (someValues['data']['directLogins'] != null) { var directLoginReference; for (directLoginReference in someValues['data']['directLogins']) { var directLogin; var directLoginParameters; directLoginParameters = someValues['data']['directLogins'][directLoginReference]; directLoginParameters.record = this; directLoginParameters.reference = directLoginReference; directLogin = new Clipperz.PM.DataModel.DirectLogin(directLoginParameters); this.addDirectLogin(directLogin, true); } } this.setShouldProcessData(false); } Clipperz.NotificationCenter.notify(this, 'recordDataReady'); |