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

Remove jquery from converse-minimize

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