src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/AbsoluteLayout.js
changeset 69 a361355b55c7
equal deleted inserted replaced
68:fd8fb93e1b6a 69:a361355b55c7
       
     1 /**
       
     2  * AbsoluteLayout.js
       
     3  *
       
     4  * Copyright, Moxiecode Systems AB
       
     5  * Released under LGPL License.
       
     6  *
       
     7  * License: http://www.tinymce.com/license
       
     8  * Contributing: http://www.tinymce.com/contributing
       
     9  */
       
    10 
       
    11 /**
       
    12  * LayoutManager for absolute positioning. This layout manager is more of
       
    13  * a base class for other layouts but can be created and used directly.
       
    14  *
       
    15  * @-x-less AbsoluteLayout.less
       
    16  * @class tinymce.ui.AbsoluteLayout
       
    17  * @extends tinymce.ui.Layout
       
    18  */
       
    19 define("tinymce/ui/AbsoluteLayout", [
       
    20 	"tinymce/ui/Layout"
       
    21 ], function(Layout) {
       
    22 	"use strict";
       
    23 
       
    24 	return Layout.extend({
       
    25 		Defaults: {
       
    26 			containerClass: 'abs-layout',
       
    27 			controlClass: 'abs-layout-item'
       
    28 		},
       
    29 
       
    30 		/**
       
    31 		 * Recalculates the positions of the controls in the specified container.
       
    32 		 *
       
    33 		 * @method recalc
       
    34 		 * @param {tinymce.ui.Container} container Container instance to recalc.
       
    35 		 */
       
    36 		recalc: function(container) {
       
    37 			container.items().filter(':visible').each(function(ctrl) {
       
    38 				var settings = ctrl.settings;
       
    39 
       
    40 				ctrl.layoutRect({
       
    41 					x: settings.x,
       
    42 					y: settings.y,
       
    43 					w: settings.w,
       
    44 					h: settings.h
       
    45 				});
       
    46 
       
    47 				if (ctrl.recalc) {
       
    48 					ctrl.recalc();
       
    49 				}
       
    50 			});
       
    51 		},
       
    52 
       
    53 		/**
       
    54 		 * Renders the specified container and any layout specific HTML.
       
    55 		 *
       
    56 		 * @method renderHtml
       
    57 		 * @param {tinymce.ui.Container} container Container to render HTML for.
       
    58 		 */
       
    59 		renderHtml: function(container) {
       
    60 			return '<div id="' + container._id + '-absend" class="' + container.classPrefix + 'abs-end"></div>' + this._super(container);
       
    61 		}
       
    62 	});
       
    63 });