Slider.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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-component-field-Slider'>/**
  19. </span> * @private
  20. */
  21. Ext.define('Ext.layout.component.field.Slider', {
  22. /* Begin Definitions */
  23. alias: ['layout.sliderfield'],
  24. extend: 'Ext.layout.component.field.Field',
  25. /* End Definitions */
  26. type: 'sliderfield',
  27. beginLayout: function(ownerContext) {
  28. this.callParent(arguments);
  29. ownerContext.endElContext = ownerContext.getEl('endEl');
  30. ownerContext.innerElContext = ownerContext.getEl('innerEl');
  31. ownerContext.bodyElContext = ownerContext.getEl('bodyEl');
  32. },
  33. publishInnerHeight: function (ownerContext, height) {
  34. var innerHeight = height - this.measureLabelErrorHeight(ownerContext),
  35. endElPad,
  36. inputPad;
  37. if (this.owner.vertical) {
  38. endElPad = ownerContext.endElContext.getPaddingInfo();
  39. inputPad = ownerContext.inputContext.getPaddingInfo();
  40. ownerContext.innerElContext.setHeight(innerHeight - inputPad.height - endElPad.height);
  41. } else {
  42. ownerContext.bodyElContext.setHeight(innerHeight);
  43. }
  44. },
  45. publishInnerWidth: function (ownerContext, width) {
  46. if (!this.owner.vertical) {
  47. var endElPad = ownerContext.endElContext.getPaddingInfo(),
  48. inputPad = ownerContext.inputContext.getPaddingInfo();
  49. ownerContext.innerElContext.setWidth(width - inputPad.left - endElPad.right - ownerContext.labelContext.getProp('width'));
  50. }
  51. },
  52. beginLayoutFixed: function(ownerContext, width, suffix) {
  53. var me = this,
  54. ieInputWidthAdjustment = me.ieInputWidthAdjustment;
  55. if (ieInputWidthAdjustment) {
  56. // adjust for IE 6/7 strict content-box model
  57. // RTL: This might have to be padding-left unless the senses of the padding styles switch when in RTL mode.
  58. me.owner.bodyEl.setStyle('padding-right', ieInputWidthAdjustment + 'px');
  59. }
  60. me.callParent(arguments);
  61. }
  62. });
  63. </pre>
  64. </body>
  65. </html>