Web UI for ARGUS server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
2.5 KiB

6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>The source code</title>
  5. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  6. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  7. </head>
  8. <body onload="prettyPrint();">
  9. <pre class="prettyprint lang-js">/*!
  10. * Ext JS Library 3.3.1
  11. * Copyright(c) 2006-2010 Sencha Inc.
  12. * licensing@sencha.com
  13. * http://www.sencha.com/license
  14. */
  15. // We are adding these custom layouts to a namespace that does not
  16. // exist by default in Ext, so we have to add the namespace first:
  17. Ext.ns('Ext.ux.layout');
  18. /**
  19. * @class Ext.ux.layout.CenterLayout
  20. * @extends Ext.layout.FitLayout
  21. * <p>This is a very simple layout style used to center contents within a container. This layout works within
  22. * nested containers and can also be used as expected as a Viewport layout to center the page layout.</p>
  23. * <p>As a subclass of FitLayout, CenterLayout expects to have a single child panel of the container that uses
  24. * the layout. The layout does not require any config options, although the child panel contained within the
  25. * layout must provide a fixed or percentage width. The child panel's height will fit to the container by
  26. * default, but you can specify <tt>autoHeight:true</tt> to allow it to autosize based on its content height.
  27. * Example usage:</p>
  28. * <pre><code>
  29. // The content panel is centered in the container
  30. var p = new Ext.Panel({
  31. title: 'Center Layout',
  32. layout: 'ux.center',
  33. items: [{
  34. title: 'Centered Content',
  35. width: '75%',
  36. html: 'Some content'
  37. }]
  38. });
  39. // If you leave the title blank and specify no border
  40. // you'll create a non-visual, structural panel just
  41. // for centering the contents in the main container.
  42. var p = new Ext.Panel({
  43. layout: 'ux.center',
  44. border: false,
  45. items: [{
  46. title: 'Centered Content',
  47. width: 300,
  48. autoHeight: true,
  49. html: 'Some content'
  50. }]
  51. });
  52. </code></pre>
  53. */
  54. Ext.ux.layout.CenterLayout = Ext.extend(Ext.layout.FitLayout, {
  55. // private
  56. setItemSize : function(item, size){
  57. this.container.addClass('ux-layout-center');
  58. item.addClass('ux-layout-center-item');
  59. if(item && size.height > 0){
  60. if(item.width){
  61. size.width = item.width;
  62. }
  63. item.setSize(size);
  64. }
  65. }
  66. });
  67. Ext.Container.LAYOUTS['ux.center'] = Ext.ux.layout.CenterLayout;
  68. </pre>
  69. </body>
  70. </html>