Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
Simplify DropTarget overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
nabcos authored and cstamas committed Nov 21, 2012
1 parent 86f1fb8 commit a1af1d8
Showing 1 changed file with 10 additions and 56 deletions.
66 changes: 10 additions & 56 deletions nexus/nexus-webapp/src/main/webapp/js/ext/dd/droptarget.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,70 +11,24 @@
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
/*global define*/
define('ext/dd/droptarget',['extjs'], function(Ext){
Ext.dd.DropTarget = function(el, config) {
this.el = Ext.get(el);
define('ext/dd/droptarget', ['extjs'], function(Ext) {
Ext.override(Ext.dd.DropTarget, {
constructor : function(el, config) {
this.el = Ext.get(el);

Ext.apply(this, config);
Ext.apply(this, config);

if (this.containerScroll)
{
Ext.dd.ScrollManager.register(this.el);
}
if (this.containerScroll) {
Ext.dd.ScrollManager.register(this.el);
}

Ext.dd.DropTarget.superclass.constructor.call(this, this.el.dom, this.ddGroup || this.group,
Ext.dd.DropTarget.superclass.constructor.call(this, this.el.dom, this.ddGroup || this.group,
// Sonatype: allow config to pass thru to Ext.dd.DDTarget constructor so padding may
// be passed from Ext.tree.TreePanel config when it need to have the whole drop panel
// set as the drop zone because this is not done by the library
config || {
isTarget : true
});
};

Ext.dd.DropTarget = function(el, config) {
this.el = Ext.get(el);

Ext.apply(this, config);

if (this.containerScroll)
{
Ext.dd.ScrollManager.register(this.el);
}

Ext.dd.DropTarget.superclass.constructor.call(this, this.el.dom, this.ddGroup || this.group,
// Sonatype: allow config to pass thru to Ext.dd.DDTarget constructor so
// padding may
// be passed from Ext.tree.TreePanel config when it need to have the whole
// drop panel
// set as the drop zone because this is not done by the library
config || {
isTarget : true
});
};

Ext.extend(Ext.dd.DropTarget, Ext.dd.DDTarget, {
dropAllowed : "x-dd-drop-ok",
dropNotAllowed : "x-dd-drop-nodrop",
isTarget : true,
isNotifyTarget : true,
notifyEnter : function(dd, e, data) {
if (this.overClass)
{
this.el.addClass(this.overClass);
}
return this.dropAllowed;
},
notifyOver : function(dd, e, data) {
return this.dropAllowed;
},
notifyOut : function(dd, e, data) {
if (this.overClass)
{
this.el.removeClass(this.overClass);
}
},
notifyDrop : function(dd, e, data) {
return false;
}
});
});
});

0 comments on commit a1af1d8

Please sign in to comment.