From dc4a48827bdfcc29fc91cfce43251d680bd2a0cd Mon Sep 17 00:00:00 2001
From: juanf <juanf@bsse-bs-dock-dhcp-293.ethz.ch>
Date: Wed, 4 Apr 2018 13:32:58 +0200
Subject: [PATCH] Bugfix, Safari 9 support

---
 .../html/js/controllers/LayoutManager.js      |  5 +--
 .../webapps/eln-lims/html/js/util/FormUtil.js | 34 +++++++++----------
 .../SampleForm/widgets/StorageListView.js     |  4 +--
 3 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/LayoutManager.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/LayoutManager.js
index 83922b9f487..808df5c63bc 100644
--- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/LayoutManager.js
+++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/LayoutManager.js
@@ -438,12 +438,13 @@ var LayoutManager = {
 	},
 	resize : function(view, forceFirstTime) {
 		if(this.canReload()) {
-			console.log("reloadView");
 			this.reloadView(view, forceFirstTime);
 		}
 	}
 }
 
 $(window).resize(function() {
-    LayoutManager.resize(mainController.views, true);
+	if(mainController && mainController.views) {
+		LayoutManager.resize(mainController.views, true);
+	}
 });
\ No newline at end of file
diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/FormUtil.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/FormUtil.js
index b590ee518e7..2f3f0ff1bc9 100644
--- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/FormUtil.js
+++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/FormUtil.js
@@ -1149,7 +1149,7 @@ var FormUtil = new function() {
     //
 
 	this.showDiskSpaceDialog = function() {
-		let _this = this;
+		var _this = this;
 
 		Util.blockUI(null, null, true);
 
@@ -1161,26 +1161,26 @@ var FormUtil = new function() {
 				Util.showError("Could not get disk space information.");
 			} else {
 
-				let $dialog = $("<div>");
+				var $dialog = $("<div>");
 				$dialog
 					.append($("<div>")
 						.append($("<legend>").text("Available storage space:")));
 
-				let $formFieldContainer = $("<div>");
+				var $formFieldContainer = $("<div>");
 				$dialog.append($formFieldContainer);
 
 				// close button
-				let $closeButton = $("<a>", {
+				var $closeButton = $("<a>", {
 					class : "btn btn-default",
 					id : "dropboxFolderNameClose"
 				}).text("Close").css("margin-top", "15px");
 				$dialog.append($closeButton);
 
 				// add disk space
-				let rowHeight = "50px";
-				let barHeight = "30px";
+				var rowHeight = "50px";
+				var barHeight = "30px";
 
-				let $table  = $("<table>");
+				var $table  = $("<table>");
 				$table
 					.append($("<thead>")
 						.append($("<tr>").css("height", rowHeight)
@@ -1201,16 +1201,16 @@ var FormUtil = new function() {
 				$table.append($tbody);
 				$formFieldContainer.append($table);
 
-				let diskSpaceValues = result.data;
-				for (let i=0; i<diskSpaceValues.length; i++) {
-					let filesystem = diskSpaceValues[i]["Mounted_on"]
-					let size = diskSpaceValues[i]["Size"]
-					let used = diskSpaceValues[i]["Used"]
-					let avail = diskSpaceValues[i]["Avail"]
-					let usedPercentage = diskSpaceValues[i]["UsedPercentage"]
+				var diskSpaceValues = result.data;
+				for (var i=0; i<diskSpaceValues.length; i++) {
+					var filesystem = diskSpaceValues[i]["Mounted_on"]
+					var size = diskSpaceValues[i]["Size"]
+					var used = diskSpaceValues[i]["Used"]
+					var avail = diskSpaceValues[i]["Avail"]
+					var usedPercentage = diskSpaceValues[i]["UsedPercentage"]
 
-					let $diskSpaceSection = $("<div>");
-					let $total = $("<div>").css({
+					var $diskSpaceSection = $("<div>");
+					var $total = $("<div>").css({
 						height : barHeight,
 						width : "100%",
 						"background-color" : "lightgray",
@@ -1220,7 +1220,7 @@ var FormUtil = new function() {
 						"line-height" : barHeight,
 					});
 					$total.text(usedPercentage);
-					let $used = $("<div>").css({
+					var $used = $("<div>").css({
 						height: barHeight,
 						width : usedPercentage,
 						"background-color" : "lightblue",
diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/widgets/StorageListView.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/widgets/StorageListView.js
index dc34da9e5be..f63c725e091 100644
--- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/widgets/StorageListView.js
+++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/widgets/StorageListView.js
@@ -144,12 +144,12 @@ function StorageListView(storageListController, storageListModel) {
 		}
 
 		// multi-select delete option
-		let isMultiselectable = false;
+		var isMultiselectable = false;
 		var extraOptions = [];
 		if(!this._storageListModel.isDisabled) {
 			isMultiselectable = true;
 			extraOptions.push({ name : "Delete selected", action : function(selected) {
-				for (let i=0; i<selected.length; i++) {
+				for (var i=0; i<selected.length; i++) {
 					_this.removeChildFromSampleOrMarkToDelete(selected[i]);
 				}
 				_this._dataGrid.refresh();
-- 
GitLab