A solution for this is to override SmartImage's disable()methods, then disable dropTarget objects. The enable() method should also be adjusted for restoring the original state.
MySmartImage = CQ.Ext.extend(CQ.html5.form.SmartImage, {
/**
* Override disable to disable drop-targets.
*/
disable : function() {
if(this.dropTargets) {
for(var k = 0; k < this.dropTargets.length; k++) {
this.dropTargets[k].lock();
}
}
MySmartImage.superclass.disable.call(this);
},
/**
* Override enable to enable drop-targets.
*/
enable : function () {
if(this.dropTargets) {
for(var k = 0; k < this.dropTargets.length; k++) {
this.dropTargets[k].unlock();
}
}
MySmartImage.superclass.enable.call(this);
}
});
//register xtype
CQ.Ext.reg('mySmartImage', MySmartImage);
The new 'mySmartImage' should be used instead of the default 'html5smartimage' xtype value in the respective configuration file.
No comments:
Post a Comment
If you have any doubts or questions, please let us know.