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 ff5ae8a80dfcaffd2cb1fbd98186ff257127082d..83922b9f487db531ea9a8cbad319af7345b2a674 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 @@ -355,9 +355,18 @@ var LayoutManager = { } }, canReload : function() { + // Don't reload when CKEditor is maximized + var ckMaximized = false; + for(editorId in CKEDITOR.instances) { + var commands = CKEDITOR.instances[editorId].commands; + if(commands && commands.maximize && commands.maximize.state == 1) { + ckMaximized = true; + } + } + return this.isResizingColumn === false && this.isLoadingView === false && - this.firstColumn.width() > 0; + !ckMaximized; }, getContentWidth : function() { var width = $( window ).width(); @@ -395,6 +404,7 @@ var LayoutManager = { var isFirstTime = this.mainContainer === null || forceFirstTime === true; // console.log("reloadView called with isFirstTime:" + isFirstTime); + this._init(isFirstTime); var width = $( window ).width(); @@ -415,6 +425,11 @@ var LayoutManager = { addResizeEventHandler : function(eventHandler) { this.resizeEventHandlers.push(eventHandler); }, + removeResizeEventHandler : function(eventHandler) { + this.resizeEventHandlers = this.resizeEventHandlers.filter(function(el) { + return el === eventHandler; + }); + }, triggerResizeEventHandlers : function() { for(var idx = 0; idx < this.resizeEventHandlers.length; idx++) { this.resizeEventHandlers[idx](); @@ -423,29 +438,12 @@ var LayoutManager = { }, resize : function(view, forceFirstTime) { if(this.canReload()) { - // console.log("reloadView"); + console.log("reloadView"); this.reloadView(view, forceFirstTime); } } } -var rtime; -var timeout = false; -var delta = 200; - $(window).resize(function() { - rtime = new Date(); - if (timeout === false) { - timeout = true; - setTimeout(resizeend, delta); - } -}); - -function resizeend() { - if (new Date() - rtime < delta) { - setTimeout(resizeend, delta); - } else { - timeout = false; - LayoutManager.resize(mainController.views, true); - } -} + 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 5586b42719771adc73a2cc1c366de9030ed41851..b01023d07758148af16ba3613405e53433c81cc7 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 @@ -816,28 +816,12 @@ var FormUtil = new function() { $component.change(function(event) { componentOnChange(event, $(this).val()); }); - } else { - var destroyAndRecreate = function($component) { - return function() { - if($component.editor) { - $component.editor.destroy(); - delete $component.editor; - } - var editor = $component.ckeditor().editor; - editor.on('change', function(event) { - var value = event.editor.getData(); - componentOnChange(event, value); - }); - } - } - - var destroyAndRecreateFunc = destroyAndRecreate($component); - - mainController.currentView._windowHandlers.push(destroyAndRecreateFunc); - - destroyAndRecreateFunc(); - - LayoutManager.addResizeEventHandler(destroyAndRecreateFunc); + } else { + var editor = $component.ckeditor().editor; + editor.on('change', function(event) { + var value = event.editor.getData(); + componentOnChange(event, value); + }); } return $component; diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/DataSetFormController.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/DataSetFormController.js index b5baff49b98ecede782fcccdd8c7a948601262d6..d64396c5753b9f427f1eade3a494f8c00a40ca39 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/DataSetFormController.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/DataSetFormController.js @@ -18,14 +18,6 @@ function DataSetFormController(parentController, mode, entity, dataSet, isMini) this._parentController = parentController; this._dataSetFormModel = new DataSetFormModel(mode, entity, dataSet, isMini); this._dataSetFormView = new DataSetFormView(this, this._dataSetFormModel); - this._windowHandlers = []; - - this.finalize = function() { - for(var whIdx = 0; whIdx < this._windowHandlers.length; whIdx++) { - $(window).off("resize", this._windowHandlers[whIdx]); - } - $("#mainContainer").css("overflow-y", "auto"); - } this.init = function(views) { var _this = this; diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ExperimentForm/ExperimentFormController.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ExperimentForm/ExperimentFormController.js index 11af163a3df1c20d7885087c060bd558963a6a89..0bd4cfb81c6f97b4ada631da5adf89dc9f08c1e5 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ExperimentForm/ExperimentFormController.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/ExperimentForm/ExperimentFormController.js @@ -18,19 +18,11 @@ function ExperimentFormController(mainController, mode, experiment) { this._mainController = mainController; this._experimentFormModel = new ExperimentFormModel(mode, experiment); this._experimentFormView = new ExperimentFormView(this, this._experimentFormModel); - this._windowHandlers = []; this.init = function(views) { this._experimentFormView.repaint(views); } - this.finalize = function() { - for(var whIdx = 0; whIdx < this._windowHandlers.length; whIdx++) { - $(window).off("resize", this._windowHandlers[whIdx]); - } - $("#mainContainer").css("overflow-y", "auto"); - } - this.isDirty = function() { return this._experimentFormModel.isFormDirty; } diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormController.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormController.js index 45a216cbfcb3bba0226650a8e1c29b40fb5b0b2d..e614a21186b7a0a2a5be95949eb48fc4ed104b96 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormController.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormController.js @@ -20,7 +20,6 @@ function SampleFormController(mainController, mode, sample, paginationInfo) { this._sampleFormView = new SampleFormView(this, this._sampleFormModel); // this._storageControllers = []; this._plateController = null; - this._windowHandlers = []; this.init = function(views) { // Loading datasets @@ -55,13 +54,6 @@ function SampleFormController(mainController, mode, sample, paginationInfo) { } } - - this.finalize = function() { - for(var whIdx = 0; whIdx < this._windowHandlers.length; whIdx++) { - $(window).off("resize", this._windowHandlers[whIdx]); - } - $("#mainContainer").css("overflow-y", "auto"); - } this.isDirty = function() { return this._sampleFormModel.isFormDirty;