Created
November 1, 2010 22:29
-
-
Save jaz303/658991 to your computer and use it in GitHub Desktop.
Hacking Boxy.load to return dialog immediately
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Boxy.load = function(url, options) { | |
options = options || {}; | |
var boxy = null; | |
var ajax = { | |
url: url, type: 'GET', dataType: 'html', cache: false, success: function(html) { | |
html = jQuery(html); | |
if (options.filter) html = jQuery(options.filter, html); | |
boxy.setContent(html); | |
if (options.center) { | |
boxy.center(); | |
} | |
boxy.show(); | |
} | |
}; | |
jQuery.each(['type', 'cache'], function() { | |
if (this in options) { | |
ajax[this] = options[this]; | |
delete options[this]; | |
} | |
}); | |
boxy = new Boxy('', jQuery.extend({}, options, {show: false})); | |
return boxy; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment