Page 1 of 1

Stock component div height

Posted: 06 April 2018, 23:39
by Woodruff
Hi everybody :)

I am developping a card classic game. In JS, I define a stock component to hold the card in the player hand. That hand can contain lots of cards, in that case the stock uses two lines.
The trouble is that the div containing the stock does not adapt because it's height is fixed for one line only. As a result, its wrapper does not contain it entirely, and this is visible when I define a background-color...

Is there any option which could let compute this height dynamically?

Thanks a lot for your help!

Tcheby

Re: Stock component div height

Posted: 07 April 2018, 16:39
by Victoria_La
I don't know the answer because I don't use any JS component but since its JS you can look at the source code and figure out
it it has any hidden properties...

That is fields in stock what is in the code:

this.page = null;
this.container_div = null;
this.item_height = null;
this.item_width = null;
this.backgroundSize = null;
this.item_type = {};
this.items = [];
this.item_selected = {};
this.next_item_id = 1;
this.control_name = null;
this.selectable = 2;
this.selectionApparance = "border";
this.apparenceBorderWidth = "1px";
this.selectionClass = "stockitem_selected";
this.extraClasses = "";
this.centerItems = false;
this.item_margin = 5;
this.autowidth = false;
this.order_items = true;
this.horizontal_overlap = 0;
this.vertical_overlap = 0;
this.use_vertical_overlap_as_offset = true;
this.onItemCreate = null;
this.onItemDelete = null;
this.jstpl_stock_item = "<div id=\"${id}\" class=\"stockitem ${extra_classes}\" style=\"top:${top}px;left:${left}px;width:${width}px;height:${height}px;${position};background-image:url('${image}');${additional_style}\"></div>";
this.image_items_per_row = null;
this.image_in_vertical_row = false;
this.hResize = null;

Re: Stock component div height

Posted: 08 April 2018, 15:01
by Woodruff
OK, in fact I don't have the problem anymore.
I changed something on my code, I don't know exactly what, and now the wrapper is design responsive.
The problem might be I had two Stock container in a row, the second one "troubbling" the first somehow...