src/pyams_skin/resources/js/myams.js
changeset 504 fb5a531cddbe
parent 501 2f0eb9a77324
child 523 c08b8f12dab5
--- a/src/pyams_skin/resources/js/myams.js	Fri Dec 28 10:06:15 2018 +0100
+++ b/src/pyams_skin/resources/js/myams.js	Fri Dec 28 10:58:26 2018 +0100
@@ -2537,9 +2537,12 @@
 																							 overflow: dialogData.amsModalOverflow || '.modal-viewport',
 																							 maxHeight: dialogData.amsModalMaxHeight === undefined ?
 																								 function() {
-																									 return $(window).height() -
+																							 		 var win_height = $(window).height(),
+																										 top_margin = parseInt(dialog.css('margin-top')),
+																									 	 top_padding = Math.round(win_height / 10);
+																									 return win_height -
 																										 $('.modal-header', content).outerHeight(true) -
-																										 $('footer', content).outerHeight(true) - 85;
+																										 $('footer', content).outerHeight(true) - top_margin - top_padding;
 																								 }
 																								 : ams.getFunctionByName(dialogData.amsModalMaxHeight)
 																						 };
@@ -4728,7 +4731,7 @@
 															widget = textarea.parents('.text-editor'),
 															data = widget.data(),
 															modeList = ace.require('ace/ext/modelist'),
-															mode = modeList.getModeForPath(widget.data('ams-editor-filename') || 'editor.txt').mode;
+															mode = data.amsEditorMode || modeList.getModeForPath(data.amsEditorFilename || 'editor.txt').mode;
 
 														// Create editor DIV
 														var textEditor = $('<div>', {