src/pyams_content/skin/resources/js/pyams_content.js
changeset 563 0d2e0946ed64
parent 535 d01efcb4d332
child 634 4e43b556a2a9
--- a/src/pyams_content/skin/resources/js/pyams_content.js	Mon May 28 16:37:13 2018 +0200
+++ b/src/pyams_content/skin/resources/js/pyams_content.js	Mon May 28 17:47:27 2018 +0200
@@ -268,6 +268,9 @@
 											switcher.removeClass('fa-plus-square-o')
 													.addClass('fa-minus-square-o');
 											para.data('ams-disabled-handlers', true);
+											MyAMS.skin.scrollTo(editor, {
+												offset: editor.height() - para.height()
+											});
 										}
 									});
 				} else {
@@ -279,6 +282,12 @@
 				}
 			},
 
+			switchLastEditor: function(table_id) {
+				var table = $('table[id="' + table_id + '"]');
+				var tr = $('tr:last', table);
+				$('[data-ams-click-handler="PyAMS_content.paragraphs.switchEditor"]', tr).click();
+			},
+
 			switchAllEditors: function(element) {
 				var source = $(this);
 				var switcher = $('i', source);