From be74885065881a3218d8522c94eb6c1f4570892b Mon Sep 17 00:00:00 2001 From: biao <iambillzhao@gmail.com> Date: Mon, 21 Dec 2015 11:28:45 +0800 Subject: [PATCH] update to use pure js to fix the coupin image. code review by XWG --- static/js/cart/select-coupon.js | 9 +++++---- static/sass/me/_coupons.scss | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/static/js/cart/select-coupon.js b/static/js/cart/select-coupon.js index cfa0c46..3dc98fa 100644 --- a/static/js/cart/select-coupon.js +++ b/static/js/cart/select-coupon.js @@ -18,12 +18,13 @@ var page = 1, var conponTmpl = Handlebars.compile($('#tmpl-coupon').html()), $newCoupon = $('#new-coupon'); +var winH = $(window).height(); + // conponNotAvaliableTmpl = Handlebars.compile($('#tmpl-coupon-not-avaliable').html()), function fixedLayOut() { - var $null = $('.null'); - - var winH = $(window).height(), + var $null = $('.null'), + navH = $('.nav-title').height(), nullH = $null.height(); if ($null.length === 0) { @@ -31,7 +32,7 @@ function fixedLayOut() { } $null.css({ - top: winH / 2 - nullH / 2 + top: winH / 2 - nullH / 2 + navH }); } diff --git a/static/sass/me/_coupons.scss b/static/sass/me/_coupons.scss index 0b7280e..a7895ed 100644 --- a/static/sass/me/_coupons.scss +++ b/static/sass/me/_coupons.scss @@ -83,7 +83,7 @@ position: absolute; left: 0; top:50%; - //@include transform(translateY(-50%)); + @include transform(translateY(-50%)); i{ width: 100%; height: 120rem / $pxConvertRem; -- libgit2 0.24.0