Skip to content
Snippets Groups Projects
Commit 8854298d authored by juanf's avatar juanf
Browse files

SSDM-2450 : Polishing

SVN: 34751
parent 432ca54c
No related branches found
No related tags found
No related merge requests found
...@@ -48,7 +48,17 @@ function MoveSampleController(samplePermId, successAction) { ...@@ -48,7 +48,17 @@ function MoveSampleController(samplePermId, successAction) {
this._moveSampleModel.experimentIdentifier, this._moveSampleModel.experimentIdentifier,
this._moveSampleModel.experimentType, function(isOK) { this._moveSampleModel.experimentType, function(isOK) {
if(isOK) { if(isOK) {
Util.showSuccess("Sample " + _this._moveSampleModel.sample.identifier + " moved to " + _this._moveSampleModel.experimentIdentifier, function() { Util.unblockUI(); if(_this._moveSampleModel.successAction) { _this._moveSampleModel.successAction(); } }); Util.showSuccess("Sample " + _this._moveSampleModel.sample.identifier + " moved to " + _this._moveSampleModel.experimentIdentifier, function() {
Util.unblockUI();
if(_this._moveSampleModel.successAction) {
//Delete Sample from current experiment menu
mainController.sideMenu.deleteUniqueIdAndMoveToParent(_this._moveSampleModel.sample.identifier, true);
//Refresh Experiment where sample was moved
mainController.sideMenu.refreshSubExperiment(_this._moveSampleModel.experimentIdentifier);
_this._moveSampleModel.successAction();
}
});
} else { } else {
Util.showError("Sample " + _this._moveSampleModel.sample.identifier + " failed " + _this._moveSampleModel.experimentIdentifier, function() {}); Util.showError("Sample " + _this._moveSampleModel.sample.identifier + " failed " + _this._moveSampleModel.experimentIdentifier, function() {});
} }
......
...@@ -30,7 +30,7 @@ function SideMenuWidgetController(mainController) { ...@@ -30,7 +30,7 @@ function SideMenuWidgetController(mainController) {
// External API for real time updates // External API for real time updates
// //
this.deleteUniqueIdAndMoveToParent = function(uniqueId) { this.deleteUniqueIdAndMoveToParent = function(uniqueId, notMoveToParent) {
var itemsToCheck = [this._sideMenuWidgetModel.menuStructure]; var itemsToCheck = [this._sideMenuWidgetModel.menuStructure];
var currentItem = null; var currentItem = null;
while(currentItem = itemsToCheck.shift()) { while(currentItem = itemsToCheck.shift()) {
...@@ -39,8 +39,11 @@ function SideMenuWidgetController(mainController) { ...@@ -39,8 +39,11 @@ function SideMenuWidgetController(mainController) {
var currentItemChild = currentItem.newMenuIfSelected.children[i]; var currentItemChild = currentItem.newMenuIfSelected.children[i];
if(currentItemChild.uniqueId === uniqueId) { if(currentItemChild.uniqueId === uniqueId) {
currentItem.newMenuIfSelected.children.splice(i,1); currentItem.newMenuIfSelected.children.splice(i,1);
mainController.changeView(currentItem.newViewIfSelected, currentItem.newViewIfSelectedData); if(!notMoveToParent) {
this._sideMenuWidgetModel.pointerToMenuNode = currentItem; mainController.changeView(currentItem.newViewIfSelected, currentItem.newViewIfSelectedData);
this._sideMenuWidgetModel.pointerToMenuNode = currentItem;
}
this._sideMenuWidgetView.repaint(); this._sideMenuWidgetView.repaint();
return; return;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment