]> git.proxmox.com Git - extjs.git/blob - extjs/examples/classic/calendar/src/dd/StatusProxy.js
add extjs 6.0.1 sources
[extjs.git] / extjs / examples / classic / calendar / src / dd / StatusProxy.js
1 /*
2 * @class Ext.calendar.dd.StatusProxy
3 * A specialized drag proxy that supports a drop status icon and auto-repair. It also
4 * contains a calendar-specific drag status message containing details about the dragged event's target drop date range.
5 * This is the default drag proxy used by all calendar views.
6 * @constructor
7 * @param {Object} config
8 */
9 Ext.define('Ext.calendar.dd.StatusProxy', {
10
11 extend: 'Ext.dd.StatusProxy',
12
13 animRepair: true,
14
15 /**
16 * @cfg {String} moveEventCls
17 * The CSS class to apply to the status element when an event is being dragged (defaults to 'ext-cal-dd-move').
18 */
19 moveEventCls : 'ext-cal-dd-move',
20
21 /**
22 * @cfg {String} addEventCls
23 * The CSS class to apply to the status element when drop is not allowed (defaults to 'ext-cal-dd-add').
24 */
25 addEventCls : 'ext-cal-dd-add',
26
27 // inherit docs
28 childEls: [
29 'ghost',
30 'message'
31 ],
32
33 // inherit docs
34 renderTpl: [
35 '<div class="' + Ext.baseCSSPrefix + 'dd-drop-icon"></div>' +
36 '<div class="ext-dd-ghost-ct">' +
37 '<div id="{id}-ghost" data-ref="ghost" class="' + Ext.baseCSSPrefix + 'dd-drag-ghost"></div>' +
38 '<div id="{id}-message" data-ref="message" class="' + Ext.baseCSSPrefix + 'dd-msg"></div>' +
39 '</div>'
40 ],
41
42 // inherit docs
43 update : function(html){
44 this.callParent(arguments);
45
46 var el = this.ghost.dom.firstChild;
47 if(el){
48 // if the ghost contains an event clone (from dragging an existing event)
49 // set it to auto height to ensure visual consistency
50 Ext.fly(el).setHeight('auto');
51 }
52 },
53
54 /* @private
55 * Update the calendar-specific drag status message without altering the ghost element.
56 * @param {String} msg The new status message
57 */
58 updateMsg : function(msg){
59 this.message.update(msg);
60 }
61 });