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

SP-909 / BIS-524 : ELN UI - Bug Fixes.

SVN: 29889
parent b8295e5c
No related branches found
No related tags found
No related merge requests found
......@@ -84,9 +84,9 @@ function SampleForm(mainController, containerId, profile, sampleTypeCode, isELNE
for(var j = 0; j < propertyTypeGroup.propertyTypes.length; j++) {
var propertyType = propertyTypeGroup.propertyTypes[j];
if(propertyType.dataType === "BOOLEAN") {
$("#"+propertyType.code).prop('checked', sample.properties[propertyType.code] === "true");
$("#"+propertyType.code.replace('$','\\$')).prop('checked', sample.properties[propertyType.code] === "true");
} else {
$("#"+propertyType.code).val(sample.properties[propertyType.code]);
$("#"+propertyType.code.replace('$','\\$')).val(sample.properties[propertyType.code]);
}
}
}
......@@ -98,7 +98,7 @@ function SampleForm(mainController, containerId, profile, sampleTypeCode, isELNE
for(var j = 0; j < propertyTypeGroup.propertyTypes.length; j++) {
var propertyType = propertyTypeGroup.propertyTypes[j];
if (localReference.mode === SampleFormMode.VIEW || propertyType.managed || propertyType.dinamic) {
$("#"+propertyType.code).prop('disabled', true);
$("#"+propertyType.code.replace('$','\\$')).prop('disabled', true);
}
}
}
......@@ -515,9 +515,9 @@ function SampleForm(mainController, containerId, profile, sampleTypeCode, isELNE
var value = null;
if (propertyType.dataType === "BOOLEAN") {
value = $("#"+propertyType.code+":checked").val() === "on";
value = $("#"+propertyType.code.replace('$','\\$')+":checked").val() === "on";
} else {
value = Util.getEmptyIfNull($("#"+propertyType.code).val());
value = Util.getEmptyIfNull($("#"+propertyType.code.replace('$','\\$')).val());
}
properties[propertyType.code] = value;
......
......@@ -31,12 +31,14 @@ var Util = new function() {
}
this.blockUINoMessage = function() {
this.unblockUI();
BlockScrollUtil.disable_scroll();
$('#navbar').block({ message: '', css: { width: '0px' } });
$.blockUI({ message: '', css: { width: '0px' } });
}
this.blockUI = function(message) {
this.unblockUI();
BlockScrollUtil.disable_scroll();
var css = {
......@@ -67,13 +69,18 @@ var Util = new function() {
}
this.showError = function(withHTML, andCallback) {
withHTML = withHTML + "<br>" + "<a class='btn'>Accept</a>";
var isiPad = navigator.userAgent.match(/iPad/i) != null;
if(!isiPad) {
withHTML = withHTML + "<br>" + "<a class='btn'>Accept</a>";
}
this.blockUINoMessage();
var localReference = this;
jError(
withHTML,
{
autoHide : false,
clickOverlay : true,
autoHide : isiPad,
clickOverlay : false,
MinWidth : 250,
TimeShown : 2000,
ShowTimeEffect : 200,
......@@ -84,19 +91,24 @@ var Util = new function() {
ShowOverlay : false,
ColorOverlay : '#000',
OpacityOverlay : 0.3,
onClosed : function(){ if(andCallback) { andCallback();}},
onClosed : function(){ if(andCallback) { andCallback();} else { localReference.unblockUI();}},
onCompleted : function(){ }
});
}
this.showSuccess = function(withHTML, andCallback) {
withHTML = withHTML + "<br>" + "<a class='btn'>Accept</a>";
var isiPad = navigator.userAgent.match(/iPad/i) != null;
if(!isiPad) {
withHTML = withHTML + "<br>" + "<a class='btn'>Accept</a>";
}
this.blockUINoMessage();
var localReference = this;
jSuccess(
withHTML,
{
autoHide : false,
clickOverlay : true,
autoHide : isiPad,
clickOverlay : false,
MinWidth : 250,
TimeShown : 2000,
ShowTimeEffect : 200,
......@@ -107,19 +119,24 @@ var Util = new function() {
ShowOverlay : false,
ColorOverlay : '#000',
OpacityOverlay : 0.3,
onClosed : function(){ if(andCallback) { andCallback();}},
onClosed : function(){ if(andCallback) { andCallback();} else { localReference.unblockUI();}},
onCompleted : function(){ }
});
}
this.showInfo = function(withHTML, andCallback) {
withHTML = withHTML + "<br>" + "<a class='btn'>Accept</a>";
var isiPad = navigator.userAgent.match(/iPad/i) != null;
if(!isiPad) {
withHTML = withHTML + "<br>" + "<a class='btn'>Accept</a>";
}
this.blockUINoMessage();
var localReference = this;
jNotify(
withHTML,
{
autoHide : false,
clickOverlay : true,
autoHide : isiPad,
clickOverlay : false,
MinWidth : 250,
TimeShown : 2000,
ShowTimeEffect : 200,
......@@ -130,7 +147,7 @@ var Util = new function() {
ShowOverlay : false,
ColorOverlay : '#000',
OpacityOverlay : 0.3,
onClosed : function(){ if(andCallback) { andCallback();}},
onClosed : function(){ if(andCallback) { andCallback();} else { localReference.unblockUI();}},
onCompleted : function(){ }
});
}
......
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