PDA

View Full Version : pruning the ext-all.js - Cannot remove ext-dd.js



Franzen
5 Aug 2010, 11:14 AM
Hi people

I'm trying to prune back the ext-all.js in readiness for production and have been using the handy Jsbuilder to try and achieve this. However, I cannot remove the ext-dd.js despite the fact that I am using no drag and drop within the site.

Can anyone offer some advice?

Thanks in advance

Condor
6 Aug 2010, 12:40 AM
Are you using Ext.Window and forgot to configure it with draggable:false?

If not, then post the stacktrace of the error when using ext-all-debug.js.

Franzen
6 Aug 2010, 10:19 AM
Hi Condor

Thanks for the reply.

I've cut a lean piece of code to test this - following:-



<head>
<title></title>
<link rel="stylesheet" type="text/css" href="ext3/css/ext-all.css" />
<script type="text/javascript" src="ext3/ext-base.js"></script>
<script type="text/javascript" src="ext3test/ext-all-debug.js"></script>
<script type="text/javascript">


Ext.onReady(function () {
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'side';


var win = new Ext.Window({
layout: 'fit',
width: 350,
height: 250,
closable: false,
resizable: false,
draggable:false,
plain: true,
border: false,
title: 'Login',
});
win.show();

});



</script>
</head>


The exception being thrown is G is undefined on line 35807.

On the following line in ext-all-debug.js




Ext.extend(Ext.Window.DD, Ext.dd.DD, {
35788 moveOnly:true,
35789 headerOffsets:[100, 25],
35790 startDrag : function(){
35791 var w = this.win;
35792 this.proxy = w.ghost();
35793 if(w.constrain !== false){
35794 var so = w.el.shadowOffset;
35795 this.constrainTo(w.container, {right: so, left: so, bottom: so});
35796 }else if(w.constrainHeader !== false){
35797 var s = this.proxy.getSize();
35798 this.constrainTo(w.container, {right: -(s.width-this.headerOffsets[0]), bottom: -(s.height-this.headerOffsets[1])});
35799 }
35800 },
35801 b4Drag : Ext.emptyFn,
35802
35803 onDrag : function(e){
35804 this.alignElWithMouse(this.proxy, e.getPageX(), e.getPageY());
35805 },
35806
35807 endDrag : function(e){
35808 this.win.unghost();
35809 this.win.saveState();
35810 }
35811});



THanks.

Condor
6 Aug 2010, 10:38 PM
Yes, the problem with Window.js is that it includes Ext.Window.DD without a check if Ext.dd.DD is actually defined.

Franzen
9 Aug 2010, 1:06 AM
Ah!

Is this likely to be fixed in a future version?

Condor
9 Aug 2010, 1:51 AM
I'll post a feature request for it.

Franzen
9 Aug 2010, 1:52 AM
Tanks for your help Condor.

I see your name all over this forum. There must be five of you right? :)