-<!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-panel.Header'>/**
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>The source code</title>
+ <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
+ <script type="text/javascript" src="../prettify/prettify.js"></script>
+ <style type="text/css">
+ .highlight { display: block; background-color: #ddd; }
+ </style>
+ <script type="text/javascript">
+ function highlight() {
+ document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
+ }
+ </script>
+</head>
+<body onload="prettyPrint(); highlight();">
+ <pre class="prettyprint lang-js"><span id='Ext-panel-Header'>/**
</span> * @class Ext.panel.Header
* @extends Ext.container.Container
* Simple header class which is used for on {@link Ext.panel.Panel} and {@link Ext.window.Window}
- * @xtype header
*/
Ext.define('Ext.panel.Header', {
extend: 'Ext.container.Container',
ariaRole : 'heading',
focusable: false,
viewBox: false,
+ flex : 1,
autoSize: true,
margins: '5 0 0 0',
items: [ me.textConfig ],
xtype : 'component',
ariaRole : 'heading',
focusable: false,
+ flex : 1,
renderTpl : ['<span class="{cls}-text {cls}-text-{ui}">{title}</span>'],
renderData: {
title: me.title,
}
me.items.push(me.titleCmp);
- // Spacer ->
- me.items.push({
- xtype: 'component',
- html : '&nbsp;',
- flex : 1,
- focusable: false
- });
-
// Add Tools
me.items = me.items.concat(me.tools);
this.callParent();
// inherit docs
addUIClsToElement: function(cls, force) {
- var me = this;
-
- me.callParent(arguments);
+ var me = this,
+ result = me.callParent(arguments),
+ classes = [me.baseCls + '-body-' + cls, me.baseCls + '-body-' + me.ui + '-' + cls],
+ array, i;
if (!force && me.rendered) {
- me.body.addCls(me.baseCls + '-body-' + cls);
- me.body.addCls(me.baseCls + '-body-' + me.ui + '-' + cls);
+ if (me.bodyCls) {
+ me.body.addCls(me.bodyCls);
+ } else {
+ me.body.addCls(classes);
+ }
+ } else {
+ if (me.bodyCls) {
+ array = me.bodyCls.split(' ');
+
+ for (i = 0; i < classes.length; i++) {
+ if (!Ext.Array.contains(array, classes[i])) {
+ array.push(classes[i]);
+ }
+ }
+
+ me.bodyCls = array.join(' ');
+ } else {
+ me.bodyCls = classes.join(' ');
+ }
}
+
+ return result;
},
// inherit docs
removeUIClsFromElement: function(cls, force) {
- var me = this;
-
- me.callParent(arguments);
+ var me = this,
+ result = me.callParent(arguments),
+ classes = [me.baseCls + '-body-' + cls, me.baseCls + '-body-' + me.ui + '-' + cls],
+ array, i;
if (!force && me.rendered) {
- me.body.removeCls(me.baseCls + '-body-' + cls);
- me.body.removeCls(me.baseCls + '-body-' + me.ui + '-' + cls);
+ if (me.bodyCls) {
+ me.body.removeCls(me.bodyCls);
+ } else {
+ me.body.removeCls(classes);
+ }
+ } else {
+ if (me.bodyCls) {
+ array = me.bodyCls.split(' ');
+
+ for (i = 0; i < classes.length; i++) {
+ Ext.Array.remove(array, classes[i]);
+ }
+
+ me.bodyCls = array.join(' ');
+ }
}
+
+ return result;
},
// inherit docs
addUIToElement: function(force) {
- var me = this;
+ var me = this,
+ array, cls;
me.callParent(arguments);
+ cls = me.baseCls + '-body-' + me.ui;
if (!force && me.rendered) {
- me.body.addCls(me.baseCls + '-body-' + me.ui);
+ if (me.bodyCls) {
+ me.body.addCls(me.bodyCls);
+ } else {
+ me.body.addCls(cls);
+ }
+ } else {
+ if (me.bodyCls) {
+ array = me.bodyCls.split(' ');
+
+ if (!Ext.Array.contains(array, cls)) {
+ array.push(cls);
+ }
+
+ me.bodyCls = array.join(' ');
+ } else {
+ me.bodyCls = cls;
+ }
}
if (!force && me.titleCmp && me.titleCmp.rendered && me.titleCmp.textEl) {
// inherit docs
removeUIFromElement: function() {
- var me = this;
+ var me = this,
+ array, cls;
me.callParent(arguments);
+ cls = me.baseCls + '-body-' + me.ui;
if (me.rendered) {
- me.body.removeCls(me.baseCls + '-body-' + me.ui);
+ if (me.bodyCls) {
+ me.body.removeCls(me.bodyCls);
+ } else {
+ me.body.removeCls(cls);
+ }
+ } else {
+ if (me.bodyCls) {
+ array = me.bodyCls.split(' ');
+ Ext.Array.remove(array, cls);
+ me.bodyCls = array.join(' ');
+ } else {
+ me.bodyCls = cls;
+ }
}
if (me.titleCmp && me.titleCmp.rendered && me.titleCmp.textEl) {
return this.body || this.frameBody || this.el;
},
-<span id='Ext-panel.Header-method-setTitle'> /**
+<span id='Ext-panel-Header-method-setTitle'> /**
</span> * Sets the title of the header.
* @param {String} title The title to be set
*/
}
},
-<span id='Ext-panel.Header-method-setIconCls'> /**
+<span id='Ext-panel-Header-method-setIconCls'> /**
</span> * Sets the CSS class that provides the icon image for this panel. This method will replace any existing
* icon class if one has already been set and fire the {@link #iconchange} event after completion.
* @param {String} cls The new CSS class name
}
},
-<span id='Ext-panel.Header-method-addTool'> /**
+<span id='Ext-panel-Header-method-addTool'> /**
</span> * Add a tool to the header
* @param {Object} tool
*/
this.tools.push(this.add(tool));
},
-<span id='Ext-panel.Header-method-onAdd'> /**
+<span id='Ext-panel-Header-method-onAdd'> /**
</span> * @private
* Set up the tools.&lt;tool type> link in the owning Panel.
* Bind the tool to its owning Panel.
}
}
});
-</pre></pre></body></html>
\ No newline at end of file
+</pre>
+</body>
+</html>