diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/deckBuildingUi.js b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/deckBuildingUi.js index ec01360b3..fe3041a2f 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/deckBuildingUi.js +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/deckBuildingUi.js @@ -25,6 +25,7 @@ var GempLotrDeckBuildingUI = Class.extend({ this.normalCollectionGroup = new NormalCardGroup(null, this.normalCollectionDiv, function(card) { return true; }); + this.normalCollectionGroup.maxCardHeight = 200; this.collectionDiv.append(this.normalCollectionDiv); this.specialCollectionDiv = $("
"); @@ -32,6 +33,7 @@ var GempLotrDeckBuildingUI = Class.extend({ this.specialCollectionGroup = new NormalCardGroup(null, this.specialCollectionDiv, function(card) { return true; }); + this.specialCollectionGroup.maxCardHeight = 200; this.collectionDiv.append(this.specialCollectionDiv); this.ringBearerDiv = $("
Ring Bearer
"); @@ -78,6 +80,7 @@ var GempLotrDeckBuildingUI = Class.extend({ this.drawDeckGroup = new NormalCardGroup(null, this.drawDeckDiv, function(card) { return (card.zone == "deck"); }); + this.drawDeckGroup.maxCardHeight = 200; this.deckDiv.append(this.drawDeckDiv); this.selectionFunc = this.addCardToDeck; @@ -208,10 +211,10 @@ var GempLotrDeckBuildingUI = Class.extend({ this.drawDeckDiv.css({ position: "absolute", left: sitesWidth * 2, top: 0, width: this.deckDiv.width() - sitesWidth * 2, height: deckHeight }); this.drawDeckGroup.setBounds(0, 0, this.deckDiv.width() - sitesWidth * 2, deckHeight); - this.normalCollectionDiv.css({ position: "absolute", left: 0, top: 0, width: this.collectionDiv.width(), height: this.collectionDiv.height() }) + this.normalCollectionDiv.css({ position: "absolute", left: 0, top: 50, width: this.collectionDiv.width(), height: this.collectionDiv.height() - 50 }) this.specialCollectionDiv.css({ position: "absolute", left: 0, top: 0, width: this.collectionDiv.width(), height: this.collectionDiv.height() }) - this.normalCollectionGroup.setBounds(0, 0, this.collectionDiv.width(), this.collectionDiv.height()); + this.normalCollectionGroup.setBounds(0, 0, this.collectionDiv.width(), this.collectionDiv.height() - 50); this.specialCollectionGroup.setBounds(0, 0, this.collectionDiv.width(), this.collectionDiv.height()); }, diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/jCardGroup.js b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/jCardGroup.js index 6c96475a2..5b14dacf0 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/jCardGroup.js +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/jCardGroup.js @@ -7,6 +7,7 @@ var CardGroup = Class.extend({ belongTestFunc: null, padding: 5, cardId: null, + maxCardHeight: null, init: function(container, belongTest) { this.container = container; @@ -166,6 +167,8 @@ var NormalCardGroup = CardGroup.extend({ tryIfCanLayoutInRows: function(rowCount, cardsToLayout) { var rowHeight = (this.height - (this.padding * (rowCount - 1))) / rowCount; + if (this.maxCardHeight != null) + rowHeight = Math.min(this.maxCardHeight, rowHeight); var totalWidth = 0; var row = 0; for (var cardId in cardsToLayout) { @@ -185,6 +188,8 @@ var NormalCardGroup = CardGroup.extend({ }, layoutInRow: function(cardsToLayout, height) { + if (this.maxCardHeight != null) + height = Math.min(this.maxCardHeight, height); var x = 0; var row = 0; var y = Math.floor((this.height - height) / 2); @@ -208,6 +213,8 @@ var NormalCardGroup = CardGroup.extend({ layoutInRows: function(rowCount, cardsToLayout) { var rowHeight = (this.height - ((rowCount - 1) * this.padding)) / rowCount; + if (this.maxCardHeight != null) + rowHeight = Math.min(this.maxCardHeight, rowHeight); var x = 0; var row = 0; var y = 0;