Commit 3a6f7ed1 authored by JC Brand's avatar JC Brand

Remove jquery from converse-minimize

parent da3670d9
......@@ -64,8 +64,8 @@
'discuss@conference.conversejs.org'
],
auto_reconnect: true,
// bosh_service_url: 'http://chat.example.org:5280/http-bind/',
bosh_service_url: 'https://conversejs.org/http-bind/', // Please use this connection manager only for testing purposes
bosh_service_url: 'http://chat.example.org:5280/http-bind/',
// bosh_service_url: 'https://conversejs.org/http-bind/', // Please use this connection manager only for testing purposes
message_archiving: 'always',
show_controlbox_by_default: true,
strict_plugin_dependencies: false,
......
......@@ -63,9 +63,13 @@
expect(_converse.minimized_chats.$('.minimized-chats-flyout').is(':visible')).toBeTruthy();
expect(_converse.minimized_chats.toggleview.model.get('collapsed')).toBeFalsy();
_converse.minimized_chats.$('#toggle-minimized-chats').click();
expect(_converse.minimized_chats.$('.minimized-chats-flyout').is(':visible')).toBeFalsy();
expect(_converse.minimized_chats.toggleview.model.get('collapsed')).toBeTruthy();
done();
return test_utils.waitUntil(function () {
return _converse.minimized_chats.$('.minimized-chats-flyout').is(':visible');
}, 500).then(function () {
expect(_converse.minimized_chats.toggleview.model.get('collapsed')).toBeTruthy();
done();
});
}));
it("shows the number messages received to minimized chats",
......
This diff is collapsed.
......@@ -389,10 +389,7 @@
[menu]
);
utils.slideInAllElements(elements).then(
_.partial(
utils.slideToggleElement,
menu
)
_.partial(utils.slideToggleElement, menu)
);
},
......
......@@ -87,8 +87,14 @@
var u = {};
u.addClass = function (el, className) {
if (el instanceof Element) {
el.classList.add(className);
}
}
u.removeClass = function (klass, el) {
if (!_.isNil(el)) {
if (el instanceof Element) {
el.classList.remove(klass);
}
return el;
......@@ -163,11 +169,12 @@
));
};
u.slideToggleElement = function (el) {
if (_.includes(el.classList, 'collapsed')) {
return u.slideOut(el);
u.slideToggleElement = function (el, duration) {
if (_.includes(el.classList, 'collapsed') ||
_.includes(el.classList, 'hidden')) {
return u.slideOut(el, duration);
} else {
return u.slideIn(el);
return u.slideIn(el, duration);
}
};
......@@ -415,6 +422,16 @@
return div.firstChild;
};
u.getOuterWidth = function (el, include_margin=false) {
var width = el.offsetWidth;
if (!include_margin) {
return width;
}
var style = window.getComputedStyle(el);
width += parseInt(style.marginLeft, 10) + parseInt(style.marginRight, 10);
return width;
};
u.stringToElement = function (s) {
/* Converts an HTML string into a DOM element.
* Expects that the HTML string has only one top-level element,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment