提交 accf8b78 编写于 作者: C Catouse

* added url refence as attribute of '.modal-dialog'.

上级 58c1dbd1
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
// ====================== // ======================
var ModalTrigger = function(options) var ModalTrigger = function(options)
{ {
options = $.extend({}, ModalTrigger.DEFAULTS, options); options = $.extend({}, ModalTrigger.DEFAULTS, $.ModalTriggerDefaults, options);
this.$modal; this.$modal;
this.isShown = false; this.isShown = false;
this.options = options; this.options = options;
...@@ -178,6 +178,7 @@ ...@@ -178,6 +178,7 @@
} }
else if(options.url) else if(options.url)
{ {
$modal.attr('ref', options.url);
if(options.type === 'iframe') if(options.type === 'iframe')
{ {
$modal.addClass('modal-iframe'); $modal.addClass('modal-iframe');
...@@ -194,9 +195,9 @@ ...@@ -194,9 +195,9 @@
that.waitTimeout = setTimeout(readyToShow, options.waittime); that.waitTimeout = setTimeout(readyToShow, options.waittime);
} }
var frame = document.getElementById(iframeName);
frame.onload = frame.onreadystatechange = function() frame.onload = frame.onreadystatechange = function()
{ {
$modal.attr('ref', frame.contentWindow.location.href);
if(that.firstLoad) $modal.addClass('modal-loading'); if(that.firstLoad) $modal.addClass('modal-loading');
if(this.readyState && this.readyState != 'complete') return; if(this.readyState && this.readyState != 'complete') return;
that.firstLoad = false; that.firstLoad = false;
...@@ -211,6 +212,7 @@ ...@@ -211,6 +212,7 @@
var frame$ = window.frames[iframeName].$; var frame$ = window.frames[iframeName].$;
if(frame$ && options.height === 'auto' && options.size != 'fullscreen') if(frame$ && options.height === 'auto' && options.size != 'fullscreen')
{ {
// todo: update iframe url to ref attribute
var $framebody = frame$('body').addClass('body-modal'); var $framebody = frame$('body').addClass('body-modal');
var ajustFrameSize = function() var ajustFrameSize = function()
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册