2013-03-15 00:01:01 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor UserInterface PanelLayout class.
|
|
|
|
*
|
|
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Panel layout.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends ve.ui.Layout
|
|
|
|
*
|
|
|
|
* @constructor
|
2013-09-25 10:21:09 +00:00
|
|
|
* @param {Object} [config] Configuration options
|
2013-07-17 19:01:49 +00:00
|
|
|
* @cfg {boolean} [scrollable] Allow vertical scrolling
|
|
|
|
* @cfg {boolean} [padded] Pad the content from the edges
|
2013-03-15 00:01:01 +00:00
|
|
|
*/
|
|
|
|
ve.ui.PanelLayout = function VeUiPanelLayout( config ) {
|
|
|
|
// Config initialization
|
|
|
|
config = config || {};
|
|
|
|
|
|
|
|
// Parent constructor
|
|
|
|
ve.ui.Layout.call( this, config );
|
|
|
|
|
|
|
|
// Initialization
|
|
|
|
this.$.addClass( 've-ui-panelLayout' );
|
2013-07-18 00:17:01 +00:00
|
|
|
if ( config.scrollable ) {
|
2013-07-17 19:01:49 +00:00
|
|
|
this.$.addClass( 've-ui-panelLayout-scrollable' );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( config.padded ) {
|
|
|
|
this.$.addClass( 've-ui-panelLayout-padded' );
|
2013-03-15 00:01:01 +00:00
|
|
|
}
|
2013-06-18 18:51:28 +00:00
|
|
|
|
|
|
|
// Add directionality class:
|
|
|
|
this.$.addClass( 've-' + this.$$.frame.dir );
|
2013-03-15 00:01:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
|
|
|
ve.inheritClass( ve.ui.PanelLayout, ve.ui.Layout );
|