Skip to content

Instantly share code, notes, and snippets.

@chicagoworks
chicagoworks / jqueryui-dialog-message.js
Created December 28, 2010 21:56
jQuery UI dialog extension to set the message body of the dialog similar to the way dialog title is set.
var __setOption = $.ui.dialog.prototype._setOption;
$.extend($.ui.dialog.prototype, {
_setOption : function (key, value) {
var self = this,
uiDialog = self.uiDialog;
if (key === 'message') {
self.element.html("" + (value || ' '));
}
__setOption.apply(self, arguments);
}
@chicagoworks
chicagoworks / jquery.offspring.js
Created January 3, 2011 20:05
jquery.offspring.js: perform the same duty as children but includes free floating 'text' nodes
//perform the same duty as children but includes free floating 'text' nodes
jQuery.fn.extend({
offspring: function() {
return jQuery(
jQuery.map( this, function(n){
return jQuery.grep(n.childNodes, function(n) {
return n.nodeType == 1 || n.nodeType == 3;
});
})
);