Initial revision of beef.dom.createIframe() Removed 'method' parameter and code path that creates a form and uses created iframe as target.

This commit is contained in:
Phil Grohe
2014-02-22 11:18:12 -05:00
parent 7554449218
commit cc51e2c294
2 changed files with 12 additions and 5 deletions

View File

@@ -111,14 +111,17 @@ beef.dom = {
* @param: {Function} a callback function to fire once the iFrame has loaded
* @return: {Object} the inserted iFrame
*/
createIframe: function(type, method, params, styles, onload) {
createIframe: function(type, params, styles, onload) {
var css = {};
var form_submit = (method.toLowerCase() == 'post') ? true : false;
/*var form_submit = (method.toLowerCase() == 'post') ? true : false;
if (form_submit && params['src'])
{
var form_action = params['src'];
params['src'] = '';
}
}*/
if (type == 'hidden') {
css = $j.extend(true, {'border':'none', 'width':'1px', 'height':'1px', 'display':'none', 'visibility':'hidden'}, styles);
} else if (type == 'fullscreen') {
@@ -130,13 +133,15 @@ beef.dom = {
}
var iframe = $j('<iframe />').attr(params).css(css).load(onload).prependTo('body');
if (form_submit && form_action)
/*
if (form_submit && form_action)
{
var id = beef.dom.generateID();
$j(iframe).attr({'id': id, 'name':id});
var form = beef.dom.createForm({'action':form_action, 'method':'get', 'target':id}, false);
$j(form).prependTo('body').submit();
}
*/
return iframe;
},