aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/dialog/dialog_options.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/dialog/dialog_options.js')
-rw-r--r--tests/unit/dialog/dialog_options.js323
1 files changed, 167 insertions, 156 deletions
diff --git a/tests/unit/dialog/dialog_options.js b/tests/unit/dialog/dialog_options.js
index 2ccbed573..a20480de6 100644
--- a/tests/unit/dialog/dialog_options.js
+++ b/tests/unit/dialog/dialog_options.js
@@ -49,12 +49,12 @@ test( "appendTo", function() {
test("autoOpen", function() {
expect(2);
- var el = $('<div></div>').dialog({ autoOpen: false });
- ok( !el.dialog("widget").is(":visible"), '.dialog({ autoOpen: false })');
+ var el = $("<div></div>").dialog({ autoOpen: false });
+ ok( !el.dialog("widget").is(":visible"), ".dialog({ autoOpen: false })");
el.remove();
- el = $('<div></div>').dialog({ autoOpen: true });
- ok( el.dialog("widget").is(":visible"), '.dialog({ autoOpen: true })');
+ el = $("<div></div>").dialog({ autoOpen: true });
+ ok( el.dialog("widget").is(":visible"), ".dialog({ autoOpen: true })");
el.remove();
});
@@ -74,7 +74,7 @@ test("buttons", function() {
equal(ev.target, btn[1], "event target");
}
},
- el = $('<div></div>').dialog({ buttons: buttons });
+ el = $("<div></div>").dialog({ buttons: buttons });
btn = el.dialog( "widget" ).find( ".ui-dialog-buttonpane button" );
equal(btn.length, 2, "number of buttons");
@@ -85,8 +85,8 @@ test("buttons", function() {
i++;
});
- ok(btn.parent().hasClass('ui-dialog-buttonset'), "buttons in container");
- ok(el.parent().hasClass('ui-dialog-buttons'), "dialog wrapper adds class about having buttons");
+ ok(btn.parent().hasClass("ui-dialog-buttonset"), "buttons in container");
+ ok(el.parent().hasClass("ui-dialog-buttons"), "dialog wrapper adds class about having buttons");
btn.trigger("click");
@@ -98,13 +98,13 @@ test("buttons", function() {
}
};
- deepEqual(el.dialog("option", "buttons"), buttons, '.dialog("option", "buttons") getter');
+ deepEqual(el.dialog("option", "buttons"), buttons, ".dialog('option', 'buttons') getter");
el.dialog("option", "buttons", newButtons);
- deepEqual(el.dialog("option", "buttons"), newButtons, '.dialog("option", "buttons", ...) setter');
+ deepEqual(el.dialog("option", "buttons"), newButtons, ".dialog('option', 'buttons', ...) setter");
btn = el.dialog( "widget" ).find( ".ui-dialog-buttonpane button" );
equal(btn.length, 1, "number of buttons after setter");
- btn.trigger('click');
+ btn.trigger("click");
i = 0;
$.each(newButtons, function( key ) {
@@ -116,7 +116,7 @@ test("buttons", function() {
btn = el.dialog( "widget" ).find( ".ui-dialog-buttonpane button" );
equal(btn.length, 0, "all buttons have been removed");
equal(el.find(".ui-dialog-buttonset").length, 0, "buttonset has been removed");
- equal(el.parent().hasClass('ui-dialog-buttons'), false, "dialog wrapper removes class about having buttons");
+ equal(el.parent().hasClass("ui-dialog-buttons"), false, "dialog wrapper removes class about having buttons");
el.remove();
});
@@ -156,77 +156,77 @@ test("buttons - advanced", function() {
test("closeOnEscape", function() {
expect( 6 );
- var el = $('<div></div>').dialog({ closeOnEscape: false });
- ok(true, 'closeOnEscape: false');
- ok(el.dialog('widget').is(':visible') && !el.dialog('widget').is(':hidden'), 'dialog is open before ESC');
- el.simulate('keydown', { keyCode: $.ui.keyCode.ESCAPE })
- .simulate('keypress', { keyCode: $.ui.keyCode.ESCAPE })
- .simulate('keyup', { keyCode: $.ui.keyCode.ESCAPE });
- ok(el.dialog('widget').is(':visible') && !el.dialog('widget').is(':hidden'), 'dialog is open after ESC');
-
- el.remove();
-
- el = $('<div></div>').dialog({ closeOnEscape: true });
- ok(true, 'closeOnEscape: true');
- ok(el.dialog('widget').is(':visible') && !el.dialog('widget').is(':hidden'), 'dialog is open before ESC');
- el.simulate('keydown', { keyCode: $.ui.keyCode.ESCAPE })
- .simulate('keypress', { keyCode: $.ui.keyCode.ESCAPE })
- .simulate('keyup', { keyCode: $.ui.keyCode.ESCAPE });
- ok(el.dialog('widget').is(':hidden') && !el.dialog('widget').is(':visible'), 'dialog is closed after ESC');
+ var el = $("<div></div>").dialog({ closeOnEscape: false });
+ ok(true, "closeOnEscape: false");
+ ok(el.dialog("widget").is(":visible") && !el.dialog("widget").is(":hidden"), "dialog is open before ESC");
+ el.simulate("keydown", { keyCode: $.ui.keyCode.ESCAPE })
+ .simulate("keypress", { keyCode: $.ui.keyCode.ESCAPE })
+ .simulate("keyup", { keyCode: $.ui.keyCode.ESCAPE });
+ ok(el.dialog("widget").is(":visible") && !el.dialog("widget").is(":hidden"), "dialog is open after ESC");
+
+ el.remove();
+
+ el = $("<div></div>").dialog({ closeOnEscape: true });
+ ok(true, "closeOnEscape: true");
+ ok(el.dialog("widget").is(":visible") && !el.dialog("widget").is(":hidden"), "dialog is open before ESC");
+ el.simulate("keydown", { keyCode: $.ui.keyCode.ESCAPE })
+ .simulate("keypress", { keyCode: $.ui.keyCode.ESCAPE })
+ .simulate("keyup", { keyCode: $.ui.keyCode.ESCAPE });
+ ok(el.dialog("widget").is(":hidden") && !el.dialog("widget").is(":visible"), "dialog is closed after ESC");
});
test("closeText", function() {
expect(3);
- var el = $('<div></div>').dialog();
- equal(el.dialog('widget').find('.ui-dialog-titlebar-close span').text(), 'close',
- 'default close text');
+ var el = $("<div></div>").dialog();
+ equal(el.dialog("widget").find(".ui-dialog-titlebar-close span").text(), "close",
+ "default close text");
el.remove();
- el = $('<div></div>').dialog({ closeText: "foo" });
- equal(el.dialog('widget').find('.ui-dialog-titlebar-close span').text(), 'foo',
- 'closeText on init');
+ el = $("<div></div>").dialog({ closeText: "foo" });
+ equal(el.dialog("widget").find(".ui-dialog-titlebar-close span").text(), "foo",
+ "closeText on init");
el.remove();
- el = $('<div></div>').dialog().dialog('option', 'closeText', 'bar');
- equal(el.dialog('widget').find('.ui-dialog-titlebar-close span').text(), 'bar',
- 'closeText via option method');
+ el = $("<div></div>").dialog().dialog("option", "closeText", "bar");
+ equal(el.dialog("widget").find(".ui-dialog-titlebar-close span").text(), "bar",
+ "closeText via option method");
el.remove();
});
test("dialogClass", function() {
expect( 6 );
- var el = $('<div></div>').dialog();
- equal(el.dialog('widget').is(".foo"), false, 'dialogClass not specified. foo class added');
+ var el = $("<div></div>").dialog();
+ equal(el.dialog("widget").is(".foo"), false, "dialogClass not specified. foo class added");
el.remove();
- el = $('<div></div>').dialog({ dialogClass: "foo" });
- equal(el.dialog('widget').is(".foo"), true, 'dialogClass in init. foo class added');
+ el = $("<div></div>").dialog({ dialogClass: "foo" });
+ equal(el.dialog("widget").is(".foo"), true, "dialogClass in init. foo class added");
el.dialog( "option", "dialogClass", "foobar" );
- equal( el.dialog('widget').is(".foo"), false, "dialogClass changed, previous one was removed" );
- equal( el.dialog('widget').is(".foobar"), true, "dialogClass changed, new one was added" );
+ equal( el.dialog("widget").is(".foo"), false, "dialogClass changed, previous one was removed" );
+ equal( el.dialog("widget").is(".foobar"), true, "dialogClass changed, new one was added" );
el.remove();
- el = $('<div></div>').dialog({ dialogClass: "foo bar" });
- equal(el.dialog('widget').is(".foo"), true, 'dialogClass in init, two classes. foo class added');
- equal(el.dialog('widget').is(".bar"), true, 'dialogClass in init, two classes. bar class added');
+ el = $("<div></div>").dialog({ dialogClass: "foo bar" });
+ equal(el.dialog("widget").is(".foo"), true, "dialogClass in init, two classes. foo class added");
+ equal(el.dialog("widget").is(".bar"), true, "dialogClass in init, two classes. bar class added");
el.remove();
});
test("draggable", function() {
expect(4);
- var el = $('<div></div>').dialog({ draggable: false });
+ var el = $("<div></div>").dialog({ draggable: false });
TestHelpers.dialog.testDrag(el, 50, -50, 0, 0);
- el.dialog('option', 'draggable', true);
+ el.dialog("option", "draggable", true);
TestHelpers.dialog.testDrag(el, 50, -50, 50, -50);
el.remove();
- el = $('<div></div>').dialog({ draggable: true });
+ el = $("<div></div>").dialog({ draggable: true });
TestHelpers.dialog.testDrag(el, 50, -50, 50, -50);
- el.dialog('option', 'draggable', false);
+ el.dialog("option", "draggable", false);
TestHelpers.dialog.testDrag(el, 50, -50, 0, 0);
el.remove();
});
@@ -234,22 +234,22 @@ test("draggable", function() {
test("height", function() {
expect(4);
- var el = $('<div></div>').dialog();
- equal(el.dialog('widget').outerHeight(), 150, "default height");
+ var el = $("<div></div>").dialog();
+ equal(el.dialog("widget").outerHeight(), 150, "default height");
el.remove();
- el = $('<div></div>').dialog({ height: 237 });
- equal(el.dialog('widget').outerHeight(), 237, "explicit height");
+ el = $("<div></div>").dialog({ height: 237 });
+ equal(el.dialog("widget").outerHeight(), 237, "explicit height");
el.remove();
- el = $('<div></div>').dialog();
- el.dialog('option', 'height', 238);
- equal(el.dialog('widget').outerHeight(), 238, "explicit height set after init");
+ el = $("<div></div>").dialog();
+ el.dialog("option", "height", 238);
+ equal(el.dialog("widget").outerHeight(), 238, "explicit height set after init");
el.remove();
- el = $('<div></div>').css("padding", "20px")
+ el = $("<div></div>").css("padding", "20px")
.dialog({ height: 240 });
- equal(el.dialog('widget').outerHeight(), 240, "explicit height with padding");
+ equal(el.dialog("widget").outerHeight(), 240, "explicit height with padding");
el.remove();
});
@@ -265,142 +265,153 @@ asyncTest( "hide, #5860 - don't leave effects wrapper behind", function() {
test("maxHeight", function() {
expect(3);
- var el = $('<div></div>').dialog({ maxHeight: 200 });
- TestHelpers.dialog.drag(el, '.ui-resizable-s', 1000, 1000);
- closeEnough(el.dialog('widget').height(), 200, 1, "maxHeight");
+ var el = $("<div></div>").dialog({ maxHeight: 200 });
+ TestHelpers.dialog.drag(el, ".ui-resizable-s", 1000, 1000);
+ closeEnough(el.dialog("widget").height(), 200, 1, "maxHeight");
el.remove();
- el = $('<div></div>').dialog({ maxHeight: 200 });
- TestHelpers.dialog.drag(el, '.ui-resizable-n', -1000, -1000);
- closeEnough(el.dialog('widget').height(), 200, 1, "maxHeight");
+ el = $("<div></div>").dialog({ maxHeight: 200 });
+ TestHelpers.dialog.drag(el, ".ui-resizable-n", -1000, -1000);
+ closeEnough(el.dialog("widget").height(), 200, 1, "maxHeight");
el.remove();
- el = $('<div></div>').dialog({ maxHeight: 200 }).dialog('option', 'maxHeight', 300);
- TestHelpers.dialog.drag(el, '.ui-resizable-s', 1000, 1000);
- closeEnough(el.dialog('widget').height(), 300, 1, "maxHeight");
+ el = $("<div></div>").dialog({ maxHeight: 200 }).dialog("option", "maxHeight", 300);
+ TestHelpers.dialog.drag(el, ".ui-resizable-s", 1000, 1000);
+ closeEnough(el.dialog("widget").height(), 300, 1, "maxHeight");
el.remove();
});
test("maxWidth", function() {
expect(3);
- var el = $('<div></div>').dialog({ maxWidth: 200 });
- TestHelpers.dialog.drag(el, '.ui-resizable-e', 1000, 1000);
- closeEnough(el.dialog('widget').width(), 200, 1, "maxWidth");
+ var el = $("<div></div>").dialog({ maxWidth: 200 });
+ TestHelpers.dialog.drag(el, ".ui-resizable-e", 1000, 1000);
+ closeEnough(el.dialog("widget").width(), 200, 1, "maxWidth");
el.remove();
- el = $('<div></div>').dialog({ maxWidth: 200 });
- TestHelpers.dialog.drag(el, '.ui-resizable-w', -1000, -1000);
- closeEnough(el.dialog('widget').width(), 200, 1, "maxWidth");
+ el = $("<div></div>").dialog({ maxWidth: 200 });
+ TestHelpers.dialog.drag(el, ".ui-resizable-w", -1000, -1000);
+ closeEnough(el.dialog("widget").width(), 200, 1, "maxWidth");
el.remove();
- el = $('<div></div>').dialog({ maxWidth: 200 }).dialog('option', 'maxWidth', 300);
- TestHelpers.dialog.drag(el, '.ui-resizable-w', -1000, -1000);
- closeEnough(el.dialog('widget').width(), 300, 1, "maxWidth");
+ el = $("<div></div>").dialog({ maxWidth: 200 }).dialog("option", "maxWidth", 300);
+ TestHelpers.dialog.drag(el, ".ui-resizable-w", -1000, -1000);
+ closeEnough(el.dialog("widget").width(), 300, 1, "maxWidth");
el.remove();
});
test("minHeight", function() {
expect(3);
- var el = $('<div></div>').dialog({ minHeight: 10 });
- TestHelpers.dialog.drag(el, '.ui-resizable-s', -1000, -1000);
- closeEnough(el.dialog('widget').height(), 10, 1, "minHeight");
+ var el = $("<div></div>").dialog({ minHeight: 10 });
+ TestHelpers.dialog.drag(el, ".ui-resizable-s", -1000, -1000);
+ closeEnough(el.dialog("widget").height(), 10, 1, "minHeight");
el.remove();
- el = $('<div></div>').dialog({ minHeight: 10 });
- TestHelpers.dialog.drag(el, '.ui-resizable-n', 1000, 1000);
- closeEnough(el.dialog('widget').height(), 10, 1, "minHeight");
+ el = $("<div></div>").dialog({ minHeight: 10 });
+ TestHelpers.dialog.drag(el, ".ui-resizable-n", 1000, 1000);
+ closeEnough(el.dialog("widget").height(), 10, 1, "minHeight");
el.remove();
- el = $('<div></div>').dialog({ minHeight: 10 }).dialog('option', 'minHeight', 30);
- TestHelpers.dialog.drag(el, '.ui-resizable-n', 1000, 1000);
- closeEnough(el.dialog('widget').height(), 30, 1, "minHeight");
+ el = $("<div></div>").dialog({ minHeight: 10 }).dialog("option", "minHeight", 30);
+ TestHelpers.dialog.drag(el, ".ui-resizable-n", 1000, 1000);
+ closeEnough(el.dialog("widget").height(), 30, 1, "minHeight");
el.remove();
});
test("minWidth", function() {
expect(3);
- var el = $('<div></div>').dialog({ minWidth: 10 });
- TestHelpers.dialog.drag(el, '.ui-resizable-e', -1000, -1000);
- closeEnough(el.dialog('widget').width(), 10, 1, "minWidth");
+ var el = $("<div></div>").dialog({ minWidth: 10 });
+ TestHelpers.dialog.drag(el, ".ui-resizable-e", -1000, -1000);
+ closeEnough(el.dialog("widget").width(), 10, 1, "minWidth");
el.remove();
- el = $('<div></div>').dialog({ minWidth: 10 });
- TestHelpers.dialog.drag(el, '.ui-resizable-w', 1000, 1000);
- closeEnough(el.dialog('widget').width(), 10, 1, "minWidth");
+ el = $("<div></div>").dialog({ minWidth: 10 });
+ TestHelpers.dialog.drag(el, ".ui-resizable-w", 1000, 1000);
+ closeEnough(el.dialog("widget").width(), 10, 1, "minWidth");
el.remove();
- el = $('<div></div>').dialog({ minWidth: 30 }).dialog('option', 'minWidth', 30);
- TestHelpers.dialog.drag(el, '.ui-resizable-w', 1000, 1000);
- closeEnough(el.dialog('widget').width(), 30, 1, "minWidth");
+ el = $("<div></div>").dialog({ minWidth: 30 }).dialog("option", "minWidth", 30);
+ TestHelpers.dialog.drag(el, ".ui-resizable-w", 1000, 1000);
+ closeEnough(el.dialog("widget").width(), 30, 1, "minWidth");
el.remove();
});
-test("position, default center on window", function() {
+test( "position, default center on window", function() {
expect( 2 );
- var el = $('<div></div>').dialog(),
- dialog = el.dialog('widget'),
+
+ // dialogs alter the window width and height in FF and IE7
+ // so we collect that information before creating the dialog
+ // Support: FF, IE7
+ var winWidth = $( window ).width(),
+ winHeight = $( window ).height(),
+ el = $("<div></div>").dialog(),
+ dialog = el.dialog("widget"),
offset = dialog.offset();
- closeEnough(offset.left, Math.round($(window).width() / 2 - dialog.outerWidth() / 2) + $(window).scrollLeft(), 1);
- closeEnough(offset.top, Math.round($(window).height() / 2 - dialog.outerHeight() / 2) + $(window).scrollTop(), 1);
+ closeEnough( offset.left, Math.round( winWidth / 2 - dialog.outerWidth() / 2 ) + $( window ).scrollLeft(), 1, "dialog left position of center on window on initilization" );
+ closeEnough( offset.top, Math.round( winHeight / 2 - dialog.outerHeight() / 2 ) + $( window ).scrollTop(), 1, "dialog top position of center on window on initilization" );
el.remove();
});
-// todo: figure out these fails in IE7
-if ( !$.ui.ie ) {
- test("position, right bottom at right bottom via ui.position args", function() {
- expect( 2 );
- var el = $('<div></div>').dialog({
- position: {
- my: "right bottom",
- at: "right bottom"
- }
- }),
- dialog = el.dialog('widget'),
- offset = dialog.offset();
+test( "position, right bottom at right bottom via ui.position args", function() {
+ expect( 2 );
- closeEnough(offset.left, $(window).width() - dialog.outerWidth() + $(window).scrollLeft(), 1);
- closeEnough(offset.top, $(window).height() - dialog.outerHeight() + $(window).scrollTop(), 1);
- el.remove();
- });
-}
+ // dialogs alter the window width and height in FF and IE7
+ // so we collect that information before creating the dialog
+ // Support: FF, IE7
+ var winWidth = $( window ).width(),
+ winHeight = $( window ).height(),
+ el = $("<div></div>").dialog({
+ position: {
+ my: "right bottom",
+ at: "right bottom"
+ }
+ }),
+ dialog = el.dialog("widget"),
+ offset = dialog.offset();
-test("position, at another element", function() {
+ closeEnough( offset.left, winWidth - dialog.outerWidth() + $( window ).scrollLeft(), 1, "dialog left position of right bottom at right bottom on initilization" );
+ closeEnough( offset.top, winHeight - dialog.outerHeight() + $( window ).scrollTop(), 1, "dialog top position of right bottom at right bottom on initilization" );
+ el.remove();
+});
+
+test( "position, at another element", function() {
expect( 4 );
- var parent = $('<div></div>').css({
- position: 'absolute',
+ var parent = $("<div></div>").css({
+ position: "absolute",
top: 400,
left: 600,
height: 10,
width: 10
- }).appendTo('body'),
+ }).appendTo("body"),
- el = $('<div></div>').dialog({
+ el = $("<div></div>").dialog({
position: {
my: "left top",
at: "left top",
- of: parent
+ of: parent,
+ collision: "none"
}
}),
- dialog = el.dialog('widget'),
+ dialog = el.dialog("widget"),
offset = dialog.offset();
- deepEqual(offset.left, 600);
- deepEqual(offset.top, 400);
+ closeEnough( offset.left, 600, 1, "dialog left position at another element on initilization" );
+ closeEnough( offset.top, 400, 1, "dialog top position at another element on initilization" );
- el.dialog('option', 'position', {
+ el.dialog("option", "position", {
my: "left top",
at: "right bottom",
- of: parent
+ of: parent,
+ collision: "none"
});
offset = dialog.offset();
- deepEqual(offset.left, 610);
- deepEqual(offset.top, 410);
+ closeEnough( offset.left, 610, 1, "dialog left position at another element via setting option" );
+ closeEnough( offset.top, 410, 1, "dialog top position at another element via setting option" );
el.remove();
parent.remove();
@@ -409,16 +420,16 @@ test("position, at another element", function() {
test("resizable", function() {
expect(4);
- var el = $('<div></div>').dialog();
+ var el = $("<div></div>").dialog();
TestHelpers.dialog.shouldResize(el, 50, 50, "[default]");
- el.dialog('option', 'resizable', false);
- TestHelpers.dialog.shouldResize(el, 0, 0, 'disabled after init');
+ el.dialog("option", "resizable", false);
+ TestHelpers.dialog.shouldResize(el, 0, 0, "disabled after init");
el.remove();
- el = $('<div></div>').dialog({ resizable: false });
+ el = $("<div></div>").dialog({ resizable: false });
TestHelpers.dialog.shouldResize(el, 0, 0, "disabled in init options");
- el.dialog('option', 'resizable', true);
- TestHelpers.dialog.shouldResize(el, 50, 50, 'enabled after init');
+ el.dialog("option", "resizable", true);
+ TestHelpers.dialog.shouldResize(el, 50, 50, "enabled after init");
el.remove();
});
@@ -426,37 +437,37 @@ test( "title", function() {
expect( 11 );
function titleText() {
- return el.dialog('widget').find( ".ui-dialog-title" ).html();
+ return el.dialog("widget").find( ".ui-dialog-title" ).html();
}
- var el = $( '<div></div>' ).dialog();
+ var el = $( "<div></div>" ).dialog();
// some browsers return a non-breaking space and some return "&nbsp;"
// so we generate a non-breaking space for comparison
equal( titleText(), $( "<span>&#160;</span>" ).html(), "[default]" );
equal( el.dialog( "option", "title" ), null, "option not changed" );
el.remove();
- el = $( '<div title="foo">' ).dialog();
+ el = $( "<div title='foo'>" ).dialog();
equal( titleText(), "foo", "title in element attribute" );
equal( el.dialog( "option", "title"), "foo", "option updated from attribute" );
el.remove();
- el = $( '<div></div>' ).dialog({ title: 'foo' });
+ el = $( "<div></div>" ).dialog({ title: "foo" });
equal( titleText(), "foo", "title in init options" );
equal( el.dialog("option", "title"), "foo", "opiton set from options hash" );
el.remove();
- el = $( '<div title="foo">' ).dialog({ title: 'bar' });
+ el = $( "<div title='foo'>" ).dialog({ title: "bar" });
equal( titleText(), "bar", "title in init options should override title in element attribute" );
equal( el.dialog("option", "title"), "bar", "opiton set from options hash" );
el.remove();
- el = $( '<div></div>' ).dialog().dialog( 'option', 'title', 'foo' );
- equal( titleText(), 'foo', 'title after init' );
+ el = $( "<div></div>" ).dialog().dialog( "option", "title", "foo" );
+ equal( titleText(), "foo", "title after init" );
el.remove();
// make sure attroperties are properly ignored - #5742 - .attr() might return a DOMElement
- el = $( '<form><input name="title"></form>' ).dialog();
+ el = $( "<form><input name='title'></form>" ).dialog();
// some browsers return a non-breaking space and some return "&nbsp;"
// so we get the text to normalize to the actual non-breaking space
equal( titleText(), $( "<span>&#160;</span>" ).html(), "[default]" );
@@ -467,34 +478,34 @@ test( "title", function() {
test("width", function() {
expect(3);
- var el = $('<div></div>').dialog();
- closeEnough(el.dialog('widget').width(), 300, 1, "default width");
+ var el = $("<div></div>").dialog();
+ closeEnough(el.dialog("widget").width(), 300, 1, "default width");
el.remove();
- el = $('<div></div>').dialog({width: 437 });
- closeEnough(el.dialog('widget').width(), 437, 1, "explicit width");
- el.dialog('option', 'width', 438);
- closeEnough(el.dialog('widget').width(), 438, 1, 'explicit width after init');
+ el = $("<div></div>").dialog({width: 437 });
+ closeEnough(el.dialog("widget").width(), 437, 1, "explicit width");
+ el.dialog("option", "width", 438);
+ closeEnough(el.dialog("widget").width(), 438, 1, "explicit width after init");
el.remove();
});
test("#4826: setting resizable false toggles resizable on dialog", function() {
expect(6);
var i,
- el = $('<div></div>').dialog({ resizable: false });
+ el = $("<div></div>").dialog({ resizable: false });
TestHelpers.dialog.shouldResize(el, 0, 0, "[default]");
for (i=0; i<2; i++) {
- el.dialog('close').dialog('open');
- TestHelpers.dialog.shouldResize(el, 0, 0, 'initialized with resizable false toggle ('+ (i+1) +')');
+ el.dialog("close").dialog("open");
+ TestHelpers.dialog.shouldResize(el, 0, 0, "initialized with resizable false toggle ("+ (i+1) +")");
}
el.remove();
- el = $('<div></div>').dialog({ resizable: true });
+ el = $("<div></div>").dialog({ resizable: true });
TestHelpers.dialog.shouldResize(el, 50, 50, "[default]");
for (i=0; i<2; i++) {
- el.dialog('close').dialog('option', 'resizable', false).dialog('open');
- TestHelpers.dialog.shouldResize(el, 0, 0, 'set option resizable false toggle ('+ (i+1) +')');
+ el.dialog("close").dialog("option", "resizable", false).dialog("open");
+ TestHelpers.dialog.shouldResize(el, 0, 0, "set option resizable false toggle ("+ (i+1) +")");
}
el.remove();