Browse Source

Pull request #1535: 无JIRA fix: 修复attributes覆盖问题

Merge in VISUAL/fineui from ~DAILER/fineui:master to master

* commit 'e445120f834ce5de2b21bc6c577a5e1451bbbcf3':
  无JIRA fix: 修复iframe attributes 问题
  无JIRA fix: 修复attributes覆盖问题  _initProps   this.options = extend(this._defaultConfig(config), props, config); 是浅extend
  无JIRA fix: 修复iframe attributes 问题
es6
guy 4 years ago
parent
commit
ca0e90b49d
  1. 16
      src/base/single/iframe/iframe.js
  2. 8
      src/base/single/img/img.js

16
src/base/single/iframe/iframe.js

@ -12,11 +12,7 @@ BI.Iframe = BI.inherit(BI.Single, {
baseCls: (conf.baseCls || "") + " bi-iframe",
src: "",
name: "",
attributes: {
frameborder: 0,
src: config.src,
name: config.name
},
attributes: {},
width: "100%",
height: "100%"
});
@ -30,6 +26,16 @@ BI.Iframe = BI.inherit(BI.Single, {
});
},
_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) {
this.options.src = src;
this.element.attr("src", src);

8
src/base/single/img/img.js

@ -19,6 +19,14 @@ BI.Img = BI.inherit(BI.Single, {
});
},
_initProps: function () {
BI.Img.superclass._initProps.apply(this, arguments);
var o = this.options;
this.options.attributes = BI.extend({
src: o.src
}, this.options.attributes);
},
setSrc: function (src) {
this.options.src = src;
this.element.attr("src", src);

Loading…
Cancel
Save