How would I make a jQuery plugin that does the following:
var login = $("#login-dialog");
login
.dialog({ autoOpen: false })
.parent(".ui-dialog")
.appendTo("form");
but returns the same as .dialog would return (that is, $("#login-dialog") again)
so I could use
login.dialogForm({ autoOpen: false})
and still keep chaining for example…
login
.dialogForm({ autoOpen: false})
.find("input:submit, button, a")
.button()
Wasn’t that hard: