change options in existing floatbox / multiple floatboxes

Page: 1

Author Post
Member
Registered: Feb 2013
Posts: 30
dear admin,

i'm implementing a chat with multiple floatboxes. each box is scrollable and user resizeable within it's allowed ranges when maximized. but additional each box get's it's own minimize and maximize icon which fires the win_minmax function. when minimized the boxes should be smaller then the on creation defined ranges and also not user resizeable any more.
i tried it with the samebox option, but this always destroys my content and i don't want to completely reload and recreate the boxes when user does just a simple minimize.


win: function(key){
fb.start('/lib/msg.php?cmd=' + 'win' +
'&id_ref=' + msg.partner.id_ref[key] +
'&ref_type=' + msg.partner.ref_type[key] +
'&key=' + key, {
type: 'ajax',
contentScroll: true,
boxScroll: false,
enableDragResize: true,
modal: false,
caption: &#039;<div id=\&#039;msg-topmnu-&#039; + msg.partner.instance[key] + &#039;\&#039;></div>&#039;,
height: BOX_HEIGHT_MSG,
width: BOX_WIDTH_MSG,
minBoxHeight: BOX_HEIGHT_MSG,
minBoxWidth: BOX_WIDTH_MSG,
minContentHeight: BOX_HEIGHT_MSG,
minContentWidth: BOX_WIDTH_MSG,
instanceName: msg.partner.instance[key],
afterItemStart: function(){
wait_ajax();
},
afterItemEnd: function(){
lazy_stop();
}
});
}
},
win_minmax: function(key){
if (msg.partner.win[key] == 1){
//min -> max
msg.partner.win[key] = 2;
$(&#039;#msg-win-minmax-&#039; + msg.partner.instance[key])
.attr(&#039;src&#039;, &#039;/img/ico/msg_win_min@&#039; + pixel_ratio + &#039;.png&#039;)
fb.getInstance(msg.partner.instance[key]).resize(BOX_WIDTH_MSG, BOX_HEIGHT_MSG);
}else{
//max -> min
msg.partner.win[key] = 1;
$(&#039;#msg-win-minmax-&#039; + msg.partner.instance[key])
.attr(&#039;src&#039;, &#039;/img/ico/msg_win_max@&#039; + pixel_ratio + &#039;.png&#039;)
fb.getInstance(msg.partner.instance[key]).resize(BOX_WIDTH_MSG, 0);
}
}
}


the above code doesn't resize because of the minimum limits created on start - and also no idea how to disable resize.

thanks for your help!
Administrator
Registered: Aug 2008
Posts: 3382
You might not be able to do what you want to do. When you set minimum box or content dimensions, these are honoured and the box cannot be re-sized to below these minimums. Similarly, when you set enableDragResize:true, the user can resize the box using the little resize dragger widget. These settings are applied at box creation time and cannot be toggled to different values after that.
Member
Registered: Feb 2013
Posts: 30
ok thanks for your reply - than i do it a little less efficient: i just save the content of the box in a temporary variable, end the instance and start a new one which gets the saved content from temporary variable.

hope javascript garbagge collection isn't so bad ;)

cheers, wolfgang

Page: 1