src/pyams_skin/resources/js/ext/tinymce/dev/classes/ui/FormItem.js
changeset 566 a1707c607eec
parent 565 318533413200
child 567 bca1726b1d85
equal deleted inserted replaced
565:318533413200 566:a1707c607eec
     1 /**
       
     2  * FormItem.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  * This class is a container created by the form element with
       
    13  * a label and control item.
       
    14  *
       
    15  * @class tinymce.ui.FormItem
       
    16  * @extends tinymce.ui.Container
       
    17  * @setting {String} label Label to display for the form item.
       
    18  */
       
    19 define("tinymce/ui/FormItem", [
       
    20 	"tinymce/ui/Container"
       
    21 ], function(Container) {
       
    22 	"use strict";
       
    23 
       
    24 	return Container.extend({
       
    25 		Defaults: {
       
    26 			layout: 'flex',
       
    27 			align: 'center',
       
    28 			defaults: {
       
    29 				flex: 1
       
    30 			}
       
    31 		},
       
    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, prefix = self.classPrefix;
       
    41 
       
    42 			self.addClass('formitem');
       
    43 			layout.preRender(self);
       
    44 
       
    45 			return (
       
    46 				'<div id="' + self._id + '" class="' + self.classes() + '" hidefocus="1" tabindex="-1">' +
       
    47 					(self.settings.title ? ('<div id="' + self._id + '-title" class="' + prefix + 'title">' +
       
    48 						self.settings.title + '</div>') : '') +
       
    49 					'<div id="' + self._id + '-body" class="' + self.classes('body') + '">' +
       
    50 						(self.settings.html || '') + layout.renderHtml(self) +
       
    51 					'</div>' +
       
    52 				'</div>'
       
    53 			);
       
    54 		}
       
    55 	});
       
    56 });