diff --git a/js/app/views/TimeSelectorUI.js b/js/app/views/TimeSelectorUI.js index 639f924..7f0573d 100644 --- a/js/app/views/TimeSelectorUI.js +++ b/js/app/views/TimeSelectorUI.js @@ -159,7 +159,9 @@ Ext.define('amdaUI.TimeSelectorUI', { notifyOver : function(ddSource, e, data) { if ((data.records[0].get('globalStart') != null) && (data.records[0].get('globalStop') != null) - && data.records[0].get('globalStart') != 'depending on mission' && data.records[0].get('isParameter')) + && data.records[0].get('globalStart') != 'depending on mission' && data.records[0].get('isParameter') + || data.records[0].get('nodeType') == 'timeTable' || data.records[0].get('nodeType') == 'sharedtimeTable' + || data.records[0].get('nodeType') == 'catalog' || data.records[0].get('nodeType') == 'sharedcatalog' ) // if ((data.records[0].get('nodeType') == 'myDataParam' || data.records[0].get('nodeType') == 'localParam') // && data.records[0].get('isParameter')) { @@ -172,17 +174,44 @@ Ext.define('amdaUI.TimeSelectorUI', { notifyDrop : function(ddSource, e, data) { if (!this.valid) return false; - + var explorerModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.explorer.id); if (!explorerModule) return false; var targetModuleId = explorerModule.getPinedModule(); var targetModule = myDesktopApp.getLoadedModule(targetModuleId); - - targetModule.getUiContent().setTimeFromData({ start : data.records[0].get('globalStart'), - stop : data.records[0].get('globalStop')}); - me.updateDuration(); - return true; + + var surveyStart = ""; + var surveyStop = ""; + + if( !data.records[0].get('isParameter') && data.records[0].get('nodeType') == 'timeTable' + || data.records[0].get('nodeType') == 'sharedtimeTable'|| data.records[0].get('nodeType') == 'catalog' + || data.records[0].get('nodeType') == 'sharedcatalog') + { + AmdaAction.getObject(data.records[0].get('id'), data.records[0].get('nodeType'), function (result, remoteEvent) { + surveyStart = result['surveyStart']; + surveyStop = result['surveyStop']; + if(surveyStart.substring(19,23) == "" && surveyStop.substring(19,23) == "") + { + surveyStart += '.000Z'; + surveyStop += ".000Z"; + } + surveyStart = '2008/01/01 01:00:00.000'; + surveyStop = '2008/01/02 01:00:00.000'; + console.log(surveyStart + " " + surveyStop); + targetModule.getUiContent().setTimeFromData({ start : surveyStart, stop : surveyStop}); + }, this); + return true; + } + else{ + console.log(data.records[0].get('globalStart')); + + targetModule.getUiContent().setTimeFromData({ start : data.records[0].get('globalStart'), + stop : data.records[0].get('globalStop')}); + me.updateDuration(); + return true; + + } } }); } -- libgit2 0.21.2