Web Interface For Lite Argus Control modules
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.

134 lines
4.7 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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. <div id="cls-Ext.menu.DateMenu"></div>/**
  16. * @class Ext.menu.DateMenu
  17. * @extends Ext.menu.Menu
  18. * <p>A menu containing an {@link Ext.DatePicker} Component.</p>
  19. * <p>Notes:</p><div class="mdetail-params"><ul>
  20. * <li>Although not listed here, the <b>constructor</b> for this class
  21. * accepts all of the configuration options of <b>{@link Ext.DatePicker}</b>.</li>
  22. * <li>If subclassing DateMenu, any configuration options for the DatePicker must be
  23. * applied to the <tt><b>initialConfig</b></tt> property of the DateMenu.
  24. * Applying {@link Ext.DatePicker DatePicker} configuration settings to
  25. * <b><tt>this</tt></b> will <b>not</b> affect the DatePicker's configuration.</li>
  26. * </ul></div>
  27. * @xtype datemenu
  28. */
  29. Ext.menu.DateMenu = Ext.extend(Ext.menu.Menu, {
  30. <div id="cfg-Ext.menu.DateMenu-enableScrolling"></div>/**
  31. * @cfg {Boolean} enableScrolling
  32. * @hide
  33. */
  34. enableScrolling : false,
  35. <div id="cfg-Ext.menu.DateMenu-handler"></div>/**
  36. * @cfg {Function} handler
  37. * Optional. A function that will handle the select event of this menu.
  38. * The handler is passed the following parameters:<div class="mdetail-params"><ul>
  39. * <li><code>picker</code> : DatePicker<div class="sub-desc">The Ext.DatePicker.</div></li>
  40. * <li><code>date</code> : Date<div class="sub-desc">The selected date.</div></li>
  41. * </ul></div>
  42. */
  43. <div id="cfg-Ext.menu.DateMenu-scope"></div>/**
  44. * @cfg {Object} scope
  45. * The scope (<tt><b>this</b></tt> reference) in which the <code>{@link #handler}</code>
  46. * function will be called. Defaults to this DateMenu instance.
  47. */
  48. <div id="cfg-Ext.menu.DateMenu-hideOnClick"></div>/**
  49. * @cfg {Boolean} hideOnClick
  50. * False to continue showing the menu after a date is selected, defaults to true.
  51. */
  52. hideOnClick : true,
  53. <div id="cfg-Ext.menu.DateMenu-pickerId"></div>/**
  54. * @cfg {String} pickerId
  55. * An id to assign to the underlying date picker. Defaults to <tt>null</tt>.
  56. */
  57. pickerId : null,
  58. <div id="cfg-Ext.menu.DateMenu-maxHeight"></div>/**
  59. * @cfg {Number} maxHeight
  60. * @hide
  61. */
  62. <div id="cfg-Ext.menu.DateMenu-scrollIncrement"></div>/**
  63. * @cfg {Number} scrollIncrement
  64. * @hide
  65. */
  66. <div id="prop-Ext.menu.DateMenu-picker"></div>/**
  67. * The {@link Ext.DatePicker} instance for this DateMenu
  68. * @property picker
  69. * @type DatePicker
  70. */
  71. cls : 'x-date-menu',
  72. <div id="event-Ext.menu.DateMenu-click"></div>/**
  73. * @event click
  74. * @hide
  75. */
  76. <div id="event-Ext.menu.DateMenu-itemclick"></div>/**
  77. * @event itemclick
  78. * @hide
  79. */
  80. initComponent : function(){
  81. this.on('beforeshow', this.onBeforeShow, this);
  82. if(this.strict = (Ext.isIE7 && Ext.isStrict)){
  83. this.on('show', this.onShow, this, {single: true, delay: 20});
  84. }
  85. Ext.apply(this, {
  86. plain: true,
  87. showSeparator: false,
  88. items: this.picker = new Ext.DatePicker(Ext.applyIf({
  89. internalRender: this.strict || !Ext.isIE,
  90. ctCls: 'x-menu-date-item',
  91. id: this.pickerId
  92. }, this.initialConfig))
  93. });
  94. this.picker.purgeListeners();
  95. Ext.menu.DateMenu.superclass.initComponent.call(this);
  96. <div id="event-Ext.menu.DateMenu-select"></div>/**
  97. * @event select
  98. * Fires when a date is selected from the {@link #picker Ext.DatePicker}
  99. * @param {DatePicker} picker The {@link #picker Ext.DatePicker}
  100. * @param {Date} date The selected date
  101. */
  102. this.relayEvents(this.picker, ['select']);
  103. this.on('show', this.picker.focus, this.picker);
  104. this.on('select', this.menuHide, this);
  105. if(this.handler){
  106. this.on('select', this.handler, this.scope || this);
  107. }
  108. },
  109. menuHide : function() {
  110. if(this.hideOnClick){
  111. this.hide(true);
  112. }
  113. },
  114. onBeforeShow : function(){
  115. if(this.picker){
  116. this.picker.hideMonthPicker(true);
  117. }
  118. },
  119. onShow : function(){
  120. var el = this.picker.getEl();
  121. el.setWidth(el.getWidth()); //nasty hack for IE7 strict mode
  122. }
  123. });
  124. Ext.reg('datemenu', Ext.menu.DateMenu);
  125. </pre>
  126. </body>
  127. </html>