jquery ui dialog cannot resize/re-position

185 views
Skip to first unread message

rme451

unread,
Apr 23, 2011, 9:42:03 AM4/23/11
to mozilla-labs-jetpack
Please excuse me if this is badly explained and/or contains poor style

My jQuery UI dialogs won't resize or re-position correctly

The dialog can be dragged if clicked over the title - it can't be
resized - the pointer changes to indicate it would be expected to

I've stripped it down to a basic example which is zipped here:

http://dl.dropbox.com/u/197051/jquery.zip

and whose xpi is here:

http://dl.dropbox.com/u/197051/jquery.xpi

The main.js looks like this

var pageMod = require("page-mod");
const data = require("self").data;

pageMod.PageMod({
include: ["http://*"],
contentScriptWhen: 'ready',
contentScriptFile: [data.url("jquery-1.5.1.min.js"),
data.url("jquery-ui-1.8.11.custom.min.js"), data.url("dialog.js")]
});



The dialog.js looks like this

$(document).ready(function() {
try {

injectCSS('http://ajax.googleapis.com/ajax/libs/jqueryui/
1.8.11/themes/base/jquery-ui.css');

var jq = jQuery.noConflict(true);

var dialogHTML = '<div id="dialog" title="test dialog"></
div>';
var dialog = jq(dialogHTML).dialog();

}
catch(ex) {
alert(ex);
}
});


any suggestions would be really welcome

Thanks in advance

KWierso

unread,
Apr 23, 2011, 9:51:57 AM4/23/11
to mozilla-labs-jetpack
All I see when I install that xpi is an alert saying "ReferenceError:
jetpack is not defined". Looks like it's coming from dialog.js's try/
catch block, when you try to define tdoc as
"jetpack.tabs.focused.contentDocument".

In a page-mod, you should already have a reference to the
contentDocument as "document".

rme451

unread,
Apr 23, 2011, 10:12:19 AM4/23/11
to mozilla-labs-jetpack
Apologies - that was the wrong version

Please re-try the same links

The code above is what I intended

Cheers
Reply all
Reply to author
Forward
0 new messages