Skip to content

Commit

Permalink
bugs of allProduct page
Browse files Browse the repository at this point in the history
  • Loading branch information
aboots committed Jun 22, 2020
1 parent 3b32f1f commit 3886556
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,6 @@ public void initialize(URL url, ResourceBundle resourceBundle) {
public void setProducts() {
int num = 0;
int row = 0;
if ((MainController.getInstance().getAllProductsController().getGoods().size() % 3 != 0)) {
if ((((MainController.getInstance().getAllProductsController().getGoods().size() / 3) + 1) * 250) > 1067) {
mainGridPane.setPrefHeight((((MainController.getInstance().getAllProductsController().getGoods().size() / 3) + 1) * 250) + 133);
}
} else {
mainGridPane.setPrefHeight((((MainController.getInstance().getAllProductsController().getGoods().size() / 3)) * 250) + 133);
}
for (Long productId : MainController.getInstance().getAllProductsController().getGoods()) {
if (MainController.getInstance().getAllProductsController().isInOff(productId)) {
VBox vbox = new ProductBriefSummery().offProductBriefSummery(productId);
Expand All @@ -189,6 +182,17 @@ public void setProducts() {
if (num % 3 == 0)
row++;
}
if (MainController.getInstance().getAllProductsController().getGoods().size() == 0)
return;
if ((MainController.getInstance().getAllProductsController().getGoods().size() % 3 != 0)) {
if ((((MainController.getInstance().getAllProductsController().getGoods().size() / 3) + 1) * 250) > 1067) {
mainGridPane.setPrefHeight((((MainController.getInstance().getAllProductsController().getGoods().size() / 3) + 1) * 250) + 133);
}
} else {
if ((((MainController.getInstance().getAllProductsController().getGoods().size() / 3) + 0) * 250) > 1067) {
mainGridPane.setPrefHeight((((MainController.getInstance().getAllProductsController().getGoods().size() / 3) + 0) * 250) + 133);
}
}
}

public void handleSorts() {
Expand Down

0 comments on commit 3886556

Please sign in to comment.