None.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>The source code</title>
  6. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  7. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  8. <style type="text/css">
  9. .highlight { display: block; background-color: #ddd; }
  10. </style>
  11. <script type="text/javascript">
  12. function highlight() {
  13. document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
  14. }
  15. </script>
  16. </head>
  17. <body onload="prettyPrint(); highlight();">
  18. <pre class="prettyprint lang-js"><span id='Ext-layout-container-boxOverflow-None'>/**
  19. </span> * @private
  20. * Base class for Box Layout overflow handlers. These specialized classes are invoked when a Box Layout
  21. * (either an HBox or a VBox) has child items that are either too wide (for HBox) or too tall (for VBox)
  22. * for its container.
  23. */
  24. Ext.define('Ext.layout.container.boxOverflow.None', {
  25. alternateClassName: 'Ext.layout.boxOverflow.None',
  26. constructor: function(layout, config) {
  27. this.layout = layout;
  28. Ext.apply(this, config);
  29. },
  30. handleOverflow: Ext.emptyFn,
  31. clearOverflow: Ext.emptyFn,
  32. beginLayout: Ext.emptyFn,
  33. beginLayoutCycle: Ext.emptyFn,
  34. finishedLayout: Ext.emptyFn,
  35. completeLayout: function (ownerContext) {
  36. var me = this,
  37. plan = ownerContext.state.boxPlan,
  38. overflow;
  39. if (plan &amp;&amp; plan.tooNarrow) {
  40. overflow = me.handleOverflow(ownerContext);
  41. if (overflow) {
  42. if (overflow.reservedSpace) {
  43. me.layout.publishInnerCtSize(ownerContext, overflow.reservedSpace);
  44. }
  45. // TODO: If we need to use the code below then we will need to pass along
  46. // the new targetSize as state and use it calculate somehow...
  47. //
  48. //if (overflow.recalculate) {
  49. // ownerContext.invalidate({
  50. // state: {
  51. // overflow: overflow
  52. // }
  53. // });
  54. //}
  55. }
  56. } else {
  57. me.clearOverflow();
  58. }
  59. },
  60. onRemove: Ext.emptyFn,
  61. <span id='Ext-layout-container-boxOverflow-None-method-getItem'> /**
  62. </span> * @private
  63. * Normalizes an item reference, string id or numerical index into a reference to the item
  64. * @param {Ext.Component/String/Number} item The item reference, id or index
  65. * @return {Ext.Component} The item
  66. */
  67. getItem: function(item) {
  68. return this.layout.owner.getComponent(item);
  69. },
  70. getOwnerType: function(owner){
  71. var type;
  72. if (owner.isToolbar) {
  73. type = 'toolbar';
  74. } else if (owner.isTabBar) {
  75. type = 'tabbar';
  76. } else if (owner.isMenu) {
  77. type = 'menu';
  78. } else {
  79. type = owner.getXType();
  80. }
  81. return type;
  82. },
  83. getPrefixConfig: Ext.emptyFn,
  84. getSuffixConfig: Ext.emptyFn,
  85. getOverflowCls: function() {
  86. return '';
  87. }
  88. });</pre>
  89. </body>
  90. </html>