src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FitLayout.js
changeset 69 a361355b55c7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FitLayout.js	Wed Jun 17 10:00:10 2015 +0200
@@ -0,0 +1,48 @@
+/**
+ * FitLayout.js
+ *
+ * Copyright, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://www.tinymce.com/license
+ * Contributing: http://www.tinymce.com/contributing
+ */
+
+/**
+ * This layout manager will resize the control to be the size of it's parent container.
+ * In other words width: 100% and height: 100%.
+ *
+ * @-x-less FitLayout.less
+ * @class tinymce.ui.FitLayout
+ * @extends tinymce.ui.AbsoluteLayout
+ */
+define("tinymce/ui/FitLayout", [
+	"tinymce/ui/AbsoluteLayout"
+], function(AbsoluteLayout) {
+	"use strict";
+
+	return AbsoluteLayout.extend({
+		/**
+		 * Recalculates the positions of the controls in the specified container.
+		 *
+		 * @method recalc
+		 * @param {tinymce.ui.Container} container Container instance to recalc.
+		 */
+		recalc: function(container) {
+			var contLayoutRect = container.layoutRect(), paddingBox = container.paddingBox();
+
+			container.items().filter(':visible').each(function(ctrl) {
+				ctrl.layoutRect({
+					x: paddingBox.left,
+					y: paddingBox.top,
+					w: contLayoutRect.innerW - paddingBox.right - paddingBox.left,
+					h: contLayoutRect.innerH - paddingBox.top - paddingBox.bottom
+				});
+
+				if (ctrl.recalc) {
+					ctrl.recalc();
+				}
+			});
+		}
+	});
+});
\ No newline at end of file