Updates #1098 IE doesn't support document.contains
This commit is contained in:
parent
9500900f22
commit
f0b1295577
|
@ -469,8 +469,7 @@
|
||||||
|
|
||||||
insertIntoControlBox () {
|
insertIntoControlBox () {
|
||||||
const controlboxview = _converse.chatboxviews.get('controlbox');
|
const controlboxview = _converse.chatboxviews.get('controlbox');
|
||||||
if (!_.isUndefined(controlboxview) &&
|
if (!_.isUndefined(controlboxview) && !u.rootContains(_converse.root, this.el)) {
|
||||||
!_converse.root.contains(this.el)) {
|
|
||||||
const el = controlboxview.el.querySelector('.bookmarks-list');
|
const el = controlboxview.el.querySelector('.bookmarks-list');
|
||||||
if (!_.isNull(el)) {
|
if (!_.isNull(el)) {
|
||||||
el.parentNode.replaceChild(this.el, el);
|
el.parentNode.replaceChild(this.el, el);
|
||||||
|
|
|
@ -181,8 +181,7 @@
|
||||||
|
|
||||||
insertIntoControlBox () {
|
insertIntoControlBox () {
|
||||||
const controlboxview = _converse.chatboxviews.get('controlbox');
|
const controlboxview = _converse.chatboxviews.get('controlbox');
|
||||||
if (!_.isUndefined(controlboxview) &&
|
if (!_.isUndefined(controlboxview) && !u.rootContains(_converse.root, this.el)) {
|
||||||
!_converse.root.contains(this.el)) {
|
|
||||||
const el = controlboxview.el.querySelector('.open-rooms-list');
|
const el = controlboxview.el.querySelector('.open-rooms-list');
|
||||||
if (!_.isNull(el)) {
|
if (!_.isNull(el)) {
|
||||||
el.parentNode.replaceChild(this.el, el);
|
el.parentNode.replaceChild(this.el, el);
|
||||||
|
|
|
@ -654,6 +654,14 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
u.rootContains = function (root, el) {
|
||||||
|
// The document element does not have the contains method in IE.
|
||||||
|
if (root === document && !root.contains) {
|
||||||
|
return document.head.contains(el) || document.body.contains(el);
|
||||||
|
}
|
||||||
|
return root.contains ? root.contains(el) : window.HTMLElement.prototype.contains.call(root, el);
|
||||||
|
};
|
||||||
|
|
||||||
u.createFragmentFromText = function (markup) {
|
u.createFragmentFromText = function (markup) {
|
||||||
/* Returns a DocumentFragment containing DOM nodes based on the
|
/* Returns a DocumentFragment containing DOM nodes based on the
|
||||||
* passed-in markup text.
|
* passed-in markup text.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user