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

SSDM-1797 : Storage (ongoing work)

SVN: 34063
parent be282efe
No related branches found
No related tags found
No related merge requests found
......@@ -21,4 +21,22 @@ function StorageListController(sample, isDisabled) {
this.init = function($container) {
this._storageListView.repaint($container);
}
this._saveState = function(storagePropGroup){
delete this._storageListModel.savedState;
var savedState = {};
for(key in storagePropGroup) {
var propertyKey = storagePropGroup[key];
if(key != "groupDisplayName") {
savedState[propertyKey] = this._storageListModel.sample.properties[propertyKey];
}
}
this._storageListModel.savedState = savedState;
}
this._restoreState = function() {
for(key in this._storageListModel.savedState) {
this._storageListModel.sample.properties[key] = this._storageListModel.savedState[key];
}
}
}
\ No newline at end of file
......@@ -17,4 +17,5 @@
function StorageListModel(sample, isDisabled) {
this.sample = sample;
this.isDisabled = isDisabled;
this.savedState = null;
}
\ No newline at end of file
......@@ -147,18 +147,20 @@ function StorageListView(storageListController, storageListModel) {
}
return count;
}
this.showStorageWidget = function(e) {
var _this = this;
var css = {
'text-align' : 'left',
'top' : '15%',
'width' : '70%',
'left' : '15%',
'right' : '20%',
'overflow' : 'auto'
'top' : '5%',
'width' : '80%',
'left' : '10%',
'right' : '10%',
'overflow' : 'auto',
'height' : '90%'
};
var container = "<div class='col-md-12 form-horizontal' id='storage-pop-up-container'></div><br><a class='btn btn-default' id='storage-accept'>Accept</a>"
var container = "<div class='col-md-12 form-horizontal' id='storage-pop-up-container'></div><br><a class='btn btn-default' id='storage-accept'>Accept</a> <a class='btn btn-default' id='storage-cancel'>Cancel</a>"
Util.blockUI(container, css);
......@@ -173,7 +175,9 @@ function StorageListView(storageListController, storageListModel) {
contentsSelector: "off",
positionSelector: "on"
});
storageController.getModel().storagePropertyGroup = profile.getStoragePropertyGroup(e.data.groupDisplayName);
var storagePropGroup = profile.getStoragePropertyGroup(e.data.groupDisplayName);
storageController.getModel().storagePropertyGroup = storagePropGroup;
this._storageListController._saveState(storagePropGroup);
storageController.bindSample(this._storageListModel.sample, this._storageListModel.isDisabled);
storageController.getView().repaint($("#storage-pop-up-container"));
......@@ -185,5 +189,11 @@ function StorageListView(storageListController, storageListModel) {
}
});
});
$("#storage-cancel").on("click", function(event) {
_this._storageListController._restoreState();
Util.unblockUI();
_this._dataGrid.refresh();
});
}
}
\ No newline at end of file
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