Loading public/javascript/app/designs/formList/main/_RequestAndParseData.js +3 −12 Original line number Diff line number Diff line Loading @@ -124,20 +124,11 @@ define([ return false; }, _chkTargetIsMine: function(response) { _chkTargetIsMine: function(res) { if (!this._chkSuccessful(response)) { return false; } var target = res.target; var body = response.body, target = body ? body.target : null; if (target && ((this._isTargetAnyOfMine && this._isTargetAnyOfMine(target)) || this._targetIsMine(target))) { return true; } return false; return (this._isTargetAnyOfMine && this._isTargetAnyOfMine(target)) || this._targetIsMine(target); }, _isTargetAnyOfMine: function(target) { Loading public/javascript/app/designs/mapWithSideContent/main/_TrackingWithList.js +1 −10 Original line number Diff line number Diff line Loading @@ -150,16 +150,7 @@ define([ _chkSelectionTargetIsBrowserWork: function(res) { if (!this._chkSuccessful(res)) { return false; } var body = res.body; if (body && body.selectionTarget && (body.selectionTarget !== this.targetBrowserWork)) { return false; } return true; return res.target === this.targetBrowserWork; }, _fillSideContent: function() { Loading public/javascript/redmic/modules/base/_ChkCollection.js +5 −9 Original line number Diff line number Diff line Loading @@ -31,15 +31,6 @@ define([ return !this.actionsPaused[action]; }, _chkSuccessful: function(response) { if (response && (response.success === undefined || response.success)) { return true; } return false; }, _chkTargetIsValid: function(obj) { // TODO eliminar cuando el server no responda con envoltorio body Loading Loading @@ -122,6 +113,11 @@ define([ })); return allowedActionsMapped.indexOf(triggeredAction) !== -1; }, _chkSuccessfulStatus: function(status) { return status >= 200 && status < 400; } }); }); public/javascript/redmic/modules/base/_Persistence.js +16 −46 Original line number Diff line number Diff line Loading @@ -70,8 +70,7 @@ define([ this.publicationsConfig.push({ event: 'SAVE', channel: this._buildChannel(this.storeChannel, this.actions.SAVE)/*, callback: '_pubSave'*/ channel: this._buildChannel(this.storeChannel, this.actions.SAVE) },{ event: 'REMOVE', channel: this._buildChannel(this.storeChannel, this.actions.REMOVE) Loading @@ -80,54 +79,18 @@ define([ this._deleteDuplicatedChannels(this.publicationsConfig); }, /*_pubSave: function(channel, obj) { var target = this._getTarget(obj.target); //var target = this._getPersistenceTarget(obj.target); this._publish(channel, { idInTarget: obj.idInTarget, target: target, item: obj.data || {}, idProperty: obj.idProperty || this.idPropertySave || this.idProperty }); }, _getTarget: function(target) { //_getPersistenceTarget: function(target) { console.debug('JAMAS DE LOS JAMASES') if (target) { return target; } if (this.baseTarget) { return this.baseTarget; } if (this.editionTarget instanceof Array) { return this.editionTarget[0]; } if (this.target instanceof Array) { return this.target[0]; } return this.editionTarget || this.target; },*/ _subSaved: function(resWrapper) { var response = resWrapper.res, status = response.status; if (!this.omitRefreshAfterSuccess) { this._emitEvt('REFRESH'); this._tryToEmitEvt('REFRESH'); } if (status >= 200 && status < 400) { if (this._chkSuccessfulStatus(status)) { var savedObj = this._getSavedObjToPublish(response) || response; this._emitEvt('SAVED', response); this._emitEvt('SAVED', savedObj); this._afterSaved(response, resWrapper); } else { Loading @@ -135,16 +98,23 @@ define([ } }, _subRemoved: function(result) { _subRemoved: function(resWrapper) { var response = resWrapper.res, status = response.status; if (!this.omitRefreshAfterSuccess) { this._emitEvt('REFRESH'); this._tryToEmitEvt('REFRESH'); } var removedObj = this._getRemovedObjToPublish(result) || result; if (this._chkSuccessfulStatus(status)) { var removedObj = this._getRemovedObjToPublish(response) || response; this._emitEvt('REMOVED', removedObj); this._afterRemoved(result); this._afterRemoved(response, resWrapper); } else { this._afterRemoveError(response.error, status, resWrapper); } } }); }); public/javascript/redmic/modules/base/_PersistenceItfc.js +4 −2 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ define([ , lang , _Itfc ) { return declare(_Itfc, { // summary: // Interfaz de _Persistence. Loading @@ -21,7 +22,8 @@ define([ '_afterSaved': {}, '_afterSaveError': {}, '_getRemovedObjToPublish': {}, '_afterRemoved': {} '_afterRemoved': {}, '_afterRemoveError': {} }); } }); Loading Loading
public/javascript/app/designs/formList/main/_RequestAndParseData.js +3 −12 Original line number Diff line number Diff line Loading @@ -124,20 +124,11 @@ define([ return false; }, _chkTargetIsMine: function(response) { _chkTargetIsMine: function(res) { if (!this._chkSuccessful(response)) { return false; } var target = res.target; var body = response.body, target = body ? body.target : null; if (target && ((this._isTargetAnyOfMine && this._isTargetAnyOfMine(target)) || this._targetIsMine(target))) { return true; } return false; return (this._isTargetAnyOfMine && this._isTargetAnyOfMine(target)) || this._targetIsMine(target); }, _isTargetAnyOfMine: function(target) { Loading
public/javascript/app/designs/mapWithSideContent/main/_TrackingWithList.js +1 −10 Original line number Diff line number Diff line Loading @@ -150,16 +150,7 @@ define([ _chkSelectionTargetIsBrowserWork: function(res) { if (!this._chkSuccessful(res)) { return false; } var body = res.body; if (body && body.selectionTarget && (body.selectionTarget !== this.targetBrowserWork)) { return false; } return true; return res.target === this.targetBrowserWork; }, _fillSideContent: function() { Loading
public/javascript/redmic/modules/base/_ChkCollection.js +5 −9 Original line number Diff line number Diff line Loading @@ -31,15 +31,6 @@ define([ return !this.actionsPaused[action]; }, _chkSuccessful: function(response) { if (response && (response.success === undefined || response.success)) { return true; } return false; }, _chkTargetIsValid: function(obj) { // TODO eliminar cuando el server no responda con envoltorio body Loading Loading @@ -122,6 +113,11 @@ define([ })); return allowedActionsMapped.indexOf(triggeredAction) !== -1; }, _chkSuccessfulStatus: function(status) { return status >= 200 && status < 400; } }); });
public/javascript/redmic/modules/base/_Persistence.js +16 −46 Original line number Diff line number Diff line Loading @@ -70,8 +70,7 @@ define([ this.publicationsConfig.push({ event: 'SAVE', channel: this._buildChannel(this.storeChannel, this.actions.SAVE)/*, callback: '_pubSave'*/ channel: this._buildChannel(this.storeChannel, this.actions.SAVE) },{ event: 'REMOVE', channel: this._buildChannel(this.storeChannel, this.actions.REMOVE) Loading @@ -80,54 +79,18 @@ define([ this._deleteDuplicatedChannels(this.publicationsConfig); }, /*_pubSave: function(channel, obj) { var target = this._getTarget(obj.target); //var target = this._getPersistenceTarget(obj.target); this._publish(channel, { idInTarget: obj.idInTarget, target: target, item: obj.data || {}, idProperty: obj.idProperty || this.idPropertySave || this.idProperty }); }, _getTarget: function(target) { //_getPersistenceTarget: function(target) { console.debug('JAMAS DE LOS JAMASES') if (target) { return target; } if (this.baseTarget) { return this.baseTarget; } if (this.editionTarget instanceof Array) { return this.editionTarget[0]; } if (this.target instanceof Array) { return this.target[0]; } return this.editionTarget || this.target; },*/ _subSaved: function(resWrapper) { var response = resWrapper.res, status = response.status; if (!this.omitRefreshAfterSuccess) { this._emitEvt('REFRESH'); this._tryToEmitEvt('REFRESH'); } if (status >= 200 && status < 400) { if (this._chkSuccessfulStatus(status)) { var savedObj = this._getSavedObjToPublish(response) || response; this._emitEvt('SAVED', response); this._emitEvt('SAVED', savedObj); this._afterSaved(response, resWrapper); } else { Loading @@ -135,16 +98,23 @@ define([ } }, _subRemoved: function(result) { _subRemoved: function(resWrapper) { var response = resWrapper.res, status = response.status; if (!this.omitRefreshAfterSuccess) { this._emitEvt('REFRESH'); this._tryToEmitEvt('REFRESH'); } var removedObj = this._getRemovedObjToPublish(result) || result; if (this._chkSuccessfulStatus(status)) { var removedObj = this._getRemovedObjToPublish(response) || response; this._emitEvt('REMOVED', removedObj); this._afterRemoved(result); this._afterRemoved(response, resWrapper); } else { this._afterRemoveError(response.error, status, resWrapper); } } }); });
public/javascript/redmic/modules/base/_PersistenceItfc.js +4 −2 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ define([ , lang , _Itfc ) { return declare(_Itfc, { // summary: // Interfaz de _Persistence. Loading @@ -21,7 +22,8 @@ define([ '_afterSaved': {}, '_afterSaveError': {}, '_getRemovedObjToPublish': {}, '_afterRemoved': {} '_afterRemoved': {}, '_afterRemoveError': {} }); } }); Loading