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.

80 lines
2.5 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*!
  2. * Ext JS Library 3.3.1
  3. * Copyright(c) 2006-2010 Sencha Inc.
  4. * licensing@sencha.com
  5. * http://www.sencha.com/license
  6. */
  7. /*
  8. * @class Ext.calendar.StatusProxy
  9. * A specialized drag proxy that supports a drop status icon, {@link Ext.Layer} styles and auto-repair. It also
  10. * contains a calendar-specific drag status message containing details about the dragged event's target drop date range.
  11. * This is the default drag proxy used by all calendar views.
  12. * @constructor
  13. * @param {Object} config
  14. */
  15. Ext.calendar.StatusProxy = function(config) {
  16. Ext.apply(this, config);
  17. this.id = this.id || Ext.id();
  18. this.el = new Ext.Layer({
  19. dh: {
  20. id: this.id,
  21. cls: 'ext-dd-drag-proxy x-dd-drag-proxy ' + this.dropNotAllowed,
  22. cn: [
  23. {
  24. cls: 'x-dd-drop-icon'
  25. },
  26. {
  27. cls: 'ext-dd-ghost-ct',
  28. cn: [
  29. {
  30. cls: 'x-dd-drag-ghost'
  31. },
  32. {
  33. cls: 'ext-dd-msg'
  34. }
  35. ]
  36. }
  37. ]
  38. },
  39. shadow: !config || config.shadow !== false
  40. });
  41. this.ghost = Ext.get(this.el.dom.childNodes[1].childNodes[0]);
  42. this.message = Ext.get(this.el.dom.childNodes[1].childNodes[1]);
  43. this.dropStatus = this.dropNotAllowed;
  44. };
  45. Ext.extend(Ext.calendar.StatusProxy, Ext.dd.StatusProxy, {
  46. /**
  47. * @cfg {String} moveEventCls
  48. * The CSS class to apply to the status element when an event is being dragged (defaults to 'ext-cal-dd-move').
  49. */
  50. moveEventCls: 'ext-cal-dd-move',
  51. /**
  52. * @cfg {String} addEventCls
  53. * The CSS class to apply to the status element when drop is not allowed (defaults to 'ext-cal-dd-add').
  54. */
  55. addEventCls: 'ext-cal-dd-add',
  56. // inherit docs
  57. update: function(html) {
  58. if (typeof html == 'string') {
  59. this.ghost.update(html);
  60. } else {
  61. this.ghost.update('');
  62. html.style.margin = '0';
  63. this.ghost.dom.appendChild(html);
  64. }
  65. var el = this.ghost.dom.firstChild;
  66. if (el) {
  67. Ext.fly(el).setStyle('float', 'none').setHeight('auto');
  68. Ext.getDom(el).id += '-ddproxy';
  69. }
  70. },
  71. /**
  72. * Update the calendar-specific drag status message without altering the ghost element.
  73. * @param {String} msg The new status message
  74. */
  75. updateMsg: function(msg) {
  76. this.message.update(msg);
  77. }
  78. });