fineui是帆软报表和BI产品线所使用的前端框架。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.3 KiB

8 years ago
/**
* @class BI.Iframe
* @extends BI.Single
* @abstract
* Created by GameJian on 2016/3/2.
*/
BI.Iframe = BI.inherit(BI.Single, {
4 years ago
_defaultConfig: function (config) {
8 years ago
var conf = BI.Iframe.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, {
6 years ago
tagName: "iframe",
8 years ago
baseCls: (conf.baseCls || "") + " bi-iframe",
src: "",
6 years ago
name: "",
attributes: {},
8 years ago
width: "100%",
height: "100%"
7 years ago
});
8 years ago
},
render: function () {
var self = this;
this.element.on("load", function () {
self.fireEvent("EVENT_LOADED");
});
8 years ago
},
_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);
},
8 years ago
setSrc: function (src) {
this.options.src = src;
this.element.attr("src", src);
},
getSrc: function () {
return this.options.src;
},
setName: function (name) {
this.options.name = name;
this.element.attr("name", name);
},
getName: function () {
return this.options.name;
8 years ago
}
});
BI.shortcut("bi.iframe", BI.Iframe);