src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/Panel.js
changeset 565 318533413200
parent 564 a1c75f3e0bc7
child 566 a1707c607eec
equal deleted inserted replaced
564:a1c75f3e0bc7 565:318533413200
     1 /**
       
     2  * Panel.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  * Creates a new panel.
       
    13  *
       
    14  * @-x-less Panel.less
       
    15  * @class tinymce.ui.Panel
       
    16  * @extends tinymce.ui.Container
       
    17  * @mixes tinymce.ui.Scrollable
       
    18  */
       
    19 define("tinymce/ui/Panel", [
       
    20 	"tinymce/ui/Container",
       
    21 	"tinymce/ui/Scrollable"
       
    22 ], function(Container, Scrollable) {
       
    23 	"use strict";
       
    24 
       
    25 	return Container.extend({
       
    26 		Defaults: {
       
    27 			layout: 'fit',
       
    28 			containerCls: 'panel'
       
    29 		},
       
    30 
       
    31 		Mixins: [Scrollable],
       
    32 
       
    33 		/**
       
    34 		 * Renders the control as a HTML string.
       
    35 		 *
       
    36 		 * @method renderHtml
       
    37 		 * @return {String} HTML representing the control.
       
    38 		 */
       
    39 		renderHtml: function() {
       
    40 			var self = this, layout = self._layout, innerHtml = self.settings.html;
       
    41 
       
    42 			self.preRender();
       
    43 			layout.preRender(self);
       
    44 
       
    45 			if (typeof innerHtml == "undefined") {
       
    46 				innerHtml = (
       
    47 					'<div id="' + self._id + '-body" class="' + self.classes('body') + '">' +
       
    48 						layout.renderHtml(self) +
       
    49 					'</div>'
       
    50 				);
       
    51 			} else {
       
    52 				if (typeof innerHtml == 'function') {
       
    53 					innerHtml = innerHtml.call(self);
       
    54 				}
       
    55 
       
    56 				self._hasBody = false;
       
    57 			}
       
    58 
       
    59 			return (
       
    60 				'<div id="' + self._id + '" class="' + self.classes() + '" hidefocus="1" tabindex="-1" role="group">' +
       
    61 					(self._preBodyHtml || '') +
       
    62 					innerHtml +
       
    63 				'</div>'
       
    64 			);
       
    65 		}
       
    66 	});
       
    67 });