diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ExperimentForm/ExperimentFormView.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ExperimentForm/ExperimentFormView.js index 408deef86486ade2a022686afd3f46eb7248cf71..1ebad6adcf85992551690cef70e32c8ecb6aebfc 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ExperimentForm/ExperimentFormView.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ExperimentForm/ExperimentFormView.js @@ -27,8 +27,7 @@ function ExperimentFormView(experimentFormController, experimentFormModel) { var $formColumn = $("<form>", { "class" : "form-horizontal form-panel-one", 'role' : "form", - 'action' : 'javascript:void(0);', - 'onsubmit' : 'mainController.currentView.updateExperiment();' + 'action' : 'javascript:void(0);' }); var $rightPanel = null; @@ -74,7 +73,7 @@ function ExperimentFormView(experimentFormController, experimentFormModel) { // Toolbar // var toolbarModel = []; - if(this._experimentFormModel.mode !== FormMode.CREATE) { + if(this._experimentFormModel.mode === FormMode.VIEW) { //Create Experiment Step if(profile.getSampleTypeForSampleTypeCode("EXPERIMENTAL_STEP") && !profile.isSampleTypeHidden("EXPERIMENTAL_STEP")) { var $createBtn = FormUtil.getButtonWithIcon("glyphicon-plus", function() { @@ -120,6 +119,13 @@ function ExperimentFormView(experimentFormController, experimentFormModel) { }); }); toolbarModel.push({ component : $export, tooltip: "Export" }); + } else { //Create and Edit + var $saveBtn = FormUtil.getButtonWithIcon("glyphicon-floppy-disk", function() { + _this._experimentFormController.updateExperiment(); + }, "Save"); + $saveBtn.removeClass("btn-default"); + $saveBtn.addClass("btn-primary"); + toolbarModel.push({ component : $saveBtn, tooltip: "Save" }); } var $header = views.header; @@ -198,24 +204,6 @@ function ExperimentFormView(experimentFormController, experimentFormModel) { $formColumn.append($dataSetUploaderContainer); } - //Create/Update Buttons - if(this._experimentFormModel.mode === FormMode.EDIT || this._experimentFormModel.mode === FormMode.CREATE) { - var btnTitle = ""; - switch(this._experimentFormModel.mode) { - case FormMode.CREATE: - btnTitle = "Create"; - break; - case FormMode.EDIT: - btnTitle = "Update"; - break; - } - - - $formColumn.append($("<br>")); - var $updateBtn = $("<input>", { "type": "submit", "class" : "btn btn-primary", 'value' : btnTitle }); - $formColumn.append($updateBtn); - } - // // INIT // diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js index 6a7437b138c0f8c831b83b7ef82ab40738090631..e14d485a7fbaed796ed2cb8c41f273655c93e041 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormView.js @@ -30,8 +30,7 @@ function SampleFormView(sampleFormController, sampleFormModel) { var $formColumn = $("<form>", { "class" : "form-horizontal form-panel-one", 'role' : "form", - 'action' : 'javascript:void(0);', - 'onsubmit' : 'mainController.currentView.createUpdateCopySample();' + 'action' : 'javascript:void(0);' }); var $rightPanel = null; @@ -228,7 +227,7 @@ function SampleFormView(sampleFormController, sampleFormModel) { toolbarModel.push({ component : $export, tooltip: "Export" }); } else { //Create and Edit var $saveBtn = FormUtil.getButtonWithIcon("glyphicon-floppy-disk", function() { - mainController.currentView.createUpdateCopySample(); + _this._sampleFormController.createUpdateCopySample(); }, "Save"); $saveBtn.removeClass("btn-default"); $saveBtn.addClass("btn-primary");