Commit f2c354b7 authored by JC Brand's avatar JC Brand

Set a class 'minimized' instead of hardcoding style

parent b189e6df
...@@ -1268,6 +1268,10 @@ form.add-xmpp-contact input { ...@@ -1268,6 +1268,10 @@ form.add-xmpp-contact input {
height: 324px; height: 324px;
} }
.box-flyout.minimized {
height: auto;
}
.chatbox .box-flyout { .chatbox .box-flyout {
width: 200px; width: 200px;
} }
......
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
handles: ['tm'], handles: ['tm'],
}); });
// Next, you must define two functions, isElement and isHandle. These are passed // Next, you must define isElement. These are passed a given DOM element, and must
// a given DOM element, and must "return true" if the element in question is a // "return true" if the element in question is a draggable element.
// draggable element or draggable handle. Here, I'm checking for the CSS classname // Here, I'm checking for the CSS classname
// of the elements, but you have have any combination of conditions you like: // of the elements, but you have have any combination of conditions you like:
dragresize.isElement = function(elm) { dragresize.isElement = function(elm) {
if (elm.className && elm.className.indexOf('box-flyout') > -1) return true; if (elm.className && elm.className.indexOf('box-flyout') > -1) return true;
...@@ -487,12 +487,13 @@ $(document).ready(function () { ...@@ -487,12 +487,13 @@ $(document).ready(function () {
} else { } else {
$grandparent.find('div.chat-content').slideToggle(300); $grandparent.find('div.chat-content').slideToggle(300);
} }
var flyout = $grandparent.find('.box-flyout')[0]; var flyout = $grandparent.find('.box-flyout');
if (flyout.style.height == 'auto') { if (flyout.hasClass('minimized')) {
flyout.style.height = '324px'; flyout.removeClass('minimized');
} else { } else {
flyout.style.height = 'auto'; flyout.addClass('minimized');
} }
$(ev.target).parent().parent().find('form.sendXMPPMessage').toggle(); $(ev.target).parent().parent().find('form.sendXMPPMessage').toggle();
}); });
......
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