cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-06-05 06:27:54 +03:00
parent 9125e1760b
commit 5a4525f86e
2 changed files with 7 additions and 10 deletions

View File

@ -87,6 +87,8 @@ var LocationActions = actions.Actions({
// NOTE: this is almost the same as .location = location but // NOTE: this is almost the same as .location = location but
// here we can access the call return value. // here we can access the call return value.
// //
// NOTE: .location will be set by the .load handler...
//
// XXX not sure about where to set the .__location -- see inside... // XXX not sure about where to set the .__location -- see inside...
loadLocation: ['File/Load location', loadLocation: ['File/Load location',
function(location){ function(location){
@ -120,7 +122,7 @@ var LocationActions = actions.Actions({
// XXX ??? // XXX ???
this.__location = location //this.__location = location
// NOTE: the method should set the proper location if it uses .clear()... // NOTE: the method should set the proper location if it uses .clear()...
var res = method && this[method](path) var res = method && this[method](path)
@ -187,9 +189,10 @@ module.Location = core.ImageGridFeatures.Feature({
}], }],
['load', ['load',
function(_, data){ function(_, data){
if(data.location){ // NOTE: we are setting this after the load because the
// loader may .clear() the viewer, thus clearing the
// .location too...
this.__location = data.location this.__location = data.location
}
}], }],
], ],
}) })

View File

@ -30,8 +30,6 @@ var RecoverActions = actions.Actions({
// NOTE: for more info on the load protocol see: base.BaseActions.load // NOTE: for more info on the load protocol see: base.BaseActions.load
load: [ load: [
function(data){ function(data){
var location = data.location
// prepare to recover, just in case... // prepare to recover, just in case...
this.__recover = (this.__recover !== false this.__recover = (this.__recover !== false
&& this.config['recover-load-errors-to-previous-location']) ? && this.config['recover-load-errors-to-previous-location']) ?
@ -39,10 +37,6 @@ var RecoverActions = actions.Actions({
: false : false
return function(){ return function(){
// NOTE: we are setting this after the load because the
// loader may .clear() the viewer, thus clearing the
// .location too...
this.__location = location
// all went well clear the recovery data... // all went well clear the recovery data...
delete this.__recover delete this.__recover