Browse Source

无JIRA fix: 修复iframe attributes 问题

es6
zsmj1994 4 years ago
parent
commit
e445120f83
  1. 17
      src/base/single/iframe/iframe.js
  2. 9
      src/base/single/img/img.js

17
src/base/single/iframe/iframe.js

@ -19,18 +19,23 @@ BI.Iframe = BI.inherit(BI.Single, {
}, },
_init: function () { _init: function () {
var self = this, o = this.options; var self = this;
BI.Iframe.superclass._init.apply(this, arguments); BI.Iframe.superclass._init.apply(this, arguments);
this.element.attr(BI.extend({
frameborder: 0,
src: o.src,
name: o.name
}, o.attributes));
this.element.on("load", function () { this.element.on("load", function () {
self.fireEvent("EVENT_LOADED"); self.fireEvent("EVENT_LOADED");
}); });
}, },
_initProps: function () {
BI.Iframe.superclass._initProps.apply(this, arguments);
var o = this.options;
this.options.attributes = BI.extend({
frameborder: 0,
src: o.src,
name: o.name
}, this.options.attributes);
},
setSrc: function (src) { setSrc: function (src) {
this.options.src = src; this.options.src = src;
this.element.attr("src", src); this.element.attr("src", src);

9
src/base/single/img/img.js

@ -19,9 +19,12 @@ BI.Img = BI.inherit(BI.Single, {
}); });
}, },
_init: function () { _initProps: function () {
BI.Img.superclass._init.apply(this, arguments); BI.Img.superclass._initProps.apply(this, arguments);
this.setSrc(this.options.src); var o = this.options;
this.options.attributes = BI.extend({
src: o.src
}, this.options.attributes);
}, },
setSrc: function (src) { setSrc: function (src) {

Loading…
Cancel
Save