Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all articles
Browse latest Browse all 4356

Commented Unassigned: Tab control destroys objects in panels, in Chrome [27731]

$
0
0
In Chrome, when a panel is deactivated (by clicking another tab) the objects in it are destroyed. This is a problem for us because we have a Java applet running there that gets reinitialized when tabbed away from.

In previous version we fixed this by changing the code. First we added this css class:
.ajax__tab_hidden {
display:block!important;
height:0!important;
width:0!important;
border:none!important;
visibility:hidden!important;
}

Then in TabPanel.cs, in Render() we changed:
// [zk] was
//writer.AddAttribute(HtmlTextWriterAttribute.Class, "ajax__tab_panel");
//if (!Active || !Enabled)
//{
// writer.AddStyleAttribute(HtmlTextWriterStyle.Display, "none");
// writer.AddStyleAttribute(HtmlTextWriterStyle.Visibility, "hidden");
//}
// [zk] updated
if (!Active || !Enabled)
writer.AddAttribute(HtmlTextWriterAttribute.Class, "ajax__tab_panel ajax__tab_hidden");
else
writer.AddAttribute(HtmlTextWriterAttribute.Class, "ajax__tab_panel");

Then in Tabs.js we made some changes:
_activate: function() {
if (this._enabled) {
var elt = this.get_element();
// [zk] was been
//$common.setVisible(elt, true);
// [zk] updated
Sys.UI.DomElement.removeCssClass(elt, "ajax__tab_hidden");
Sys.UI.DomElement.addCssClass(this._tab, "ajax__tab_active");

this.populate();
} else if (this._get_active()) {
var next = this._owner.getNearestTab(false);
if (!!next) {
this._owner.set_activeTab(next);
}
}
// [zk] condition added
if (!this._owner.get_element().style.visibility || this._owner.get_element().style.visibility != 'visible')
this._owner.get_element().style.visibility = 'visible';
},
_deactivate: function() {
var elt = this.get_element();
// [zk] was been
//$common.setVisible(elt, false);
// [zk] updated
Sys.UI.DomElement.addCssClass(elt, "ajax__tab_hidden");
Sys.UI.DomElement.removeCssClass(this._tab, "ajax__tab_active");
},
_show: function() {
// [zk] was been
//this._tab.style.display = '';
// [zk] updated
Sys.UI.DomElement.removeCssClass(this._tab, "ajax__tab_hidden");
},
_hide: function() {
// [zk] was been
//this._tab.style.display = 'none';
// [zk] updated
Sys.UI.DomElement.addCssClass(this._tab, "ajax__tab_hidden");
if (this._get_active()) {
var next = this._owner.getNearestTab(false);
if (!!next) {
this._owner.set_activeTab(next);
}
}
this._deactivate();

I have tried migrating these changes to the newest version, because there are some needed bug fixes - but it just wont work. I am attaching my changes, commented with [eec].

Please help I have been banging my head against this all week.

Comments: Do you mean an HTML <object> tag or a JavaScript object by "object"?

Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>