});
test("buttons - advanced", function() {
- expect(5);
+ expect( 7 );
var buttons,
el = $("<div></div>").dialog({
id: "my-button-id",
click: function() {
equal(this, el[0], "correct context");
- }
+ },
+ icons: {
+ primary: "ui-icon-cancel"
+ },
+ showText: false
}
]
});
equal(buttons.attr("id"), "my-button-id", "correct id");
equal(buttons.text(), "a button", "correct label");
ok(buttons.hasClass("additional-class"), "additional classes added");
+ deepEqual( buttons.button("option", "icons"), { primary: "ui-icon-cancel", secondary: null } );
+ equal( buttons.button( "option", "text" ), false );
buttons.click();
el.remove();
click.apply( that.element[0], arguments );
};
$( "<button></button>", props )
- // TODO allow passing through button options
- .button()
+ .button({
+ icons: props.icons,
+ text: props.showText
+ })
.appendTo( that.uiButtonSet );
});
this.uiDialog.addClass( "ui-dialog-buttons" );