Browse Source

Fix main navbar jumping on shop basket modal dialog

Vova Tkach 5 years ago
parent
commit
5287a05259

+ 2 - 2
assets/template/header_html_file.go

@@ -20,10 +20,10 @@ var VarHeaderHtmlFile = []byte(`<!doctype html>
 		<!-- Template CSS file from template folder -->
 		<!-- Template CSS file from template folder -->
 		<link rel="stylesheet" href="{{$.System.PathThemeStyles}}?v=3">
 		<link rel="stylesheet" href="{{$.System.PathThemeStyles}}?v=3">
 	</head>
 	</head>
-	<body class="fixed-top-bar">
+	<body id="body" class="fixed-top-bar">
 		<div id="sys-modal-shop-basket-placeholder"></div>
 		<div id="sys-modal-shop-basket-placeholder"></div>
 		<div id="wrap">
 		<div id="wrap">
-			<nav class="navbar navbar-expand-lg navbar-light bg-light">
+			<nav id="navbar-top" class="navbar navbar-expand-lg navbar-light bg-light">
 				<div class="container">
 				<div class="container">
 					<a class="navbar-brand" href="/">Fave {{$.System.InfoVersion}}</a>
 					<a class="navbar-brand" href="/">Fave {{$.System.InfoVersion}}</a>
 					<button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
 					<button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">

+ 2 - 0
assets/template/scripts_js_file.go

@@ -195,12 +195,14 @@ var VarScriptsJsFile = []byte(`(function(window, $) {
 					});
 					});
 					$('#sys-modal-shop-basket').on('hidden.bs.modal', function(e) {
 					$('#sys-modal-shop-basket').on('hidden.bs.modal', function(e) {
 						$('#sys-modal-shop-basket-placeholder').html('');
 						$('#sys-modal-shop-basket-placeholder').html('');
+						$('#navbar-top').css('margin-right', $('#body').css('padding-right'));
 					});
 					});
 
 
 					ShopBasketAjaxProductsHtml(function(html, total) {
 					ShopBasketAjaxProductsHtml(function(html, total) {
 						$('#sys-modal-shop-basket .modal-body .data').html(html);
 						$('#sys-modal-shop-basket .modal-body .data').html(html);
 						ShopBasketEnableDisableOrderBtn(total);
 						ShopBasketEnableDisableOrderBtn(total);
 						$("#sys-modal-shop-basket").modal('show');
 						$("#sys-modal-shop-basket").modal('show');
+						$('#navbar-top').css('margin-right', $('#body').css('padding-right'));
 					}, function(xhr, status, error) {
 					}, function(xhr, status, error) {
 						window.location.reload(true);
 						window.location.reload(true);
 					});
 					});

+ 2 - 2
hosts/localhost/template/header.html

@@ -18,10 +18,10 @@
 		<!-- Template CSS file from template folder -->
 		<!-- Template CSS file from template folder -->
 		<link rel="stylesheet" href="{{$.System.PathThemeStyles}}?v=3">
 		<link rel="stylesheet" href="{{$.System.PathThemeStyles}}?v=3">
 	</head>
 	</head>
-	<body class="fixed-top-bar">
+	<body id="body" class="fixed-top-bar">
 		<div id="sys-modal-shop-basket-placeholder"></div>
 		<div id="sys-modal-shop-basket-placeholder"></div>
 		<div id="wrap">
 		<div id="wrap">
-			<nav class="navbar navbar-expand-lg navbar-light bg-light">
+			<nav id="navbar-top" class="navbar navbar-expand-lg navbar-light bg-light">
 				<div class="container">
 				<div class="container">
 					<a class="navbar-brand" href="/">Fave {{$.System.InfoVersion}}</a>
 					<a class="navbar-brand" href="/">Fave {{$.System.InfoVersion}}</a>
 					<button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
 					<button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">

+ 2 - 0
hosts/localhost/template/scripts.js

@@ -193,12 +193,14 @@
 					});
 					});
 					$('#sys-modal-shop-basket').on('hidden.bs.modal', function(e) {
 					$('#sys-modal-shop-basket').on('hidden.bs.modal', function(e) {
 						$('#sys-modal-shop-basket-placeholder').html('');
 						$('#sys-modal-shop-basket-placeholder').html('');
+						$('#navbar-top').css('margin-right', $('#body').css('padding-right'));
 					});
 					});
 
 
 					ShopBasketAjaxProductsHtml(function(html, total) {
 					ShopBasketAjaxProductsHtml(function(html, total) {
 						$('#sys-modal-shop-basket .modal-body .data').html(html);
 						$('#sys-modal-shop-basket .modal-body .data').html(html);
 						ShopBasketEnableDisableOrderBtn(total);
 						ShopBasketEnableDisableOrderBtn(total);
 						$("#sys-modal-shop-basket").modal('show');
 						$("#sys-modal-shop-basket").modal('show');
+						$('#navbar-top').css('margin-right', $('#body').css('padding-right'));
 					}, function(xhr, status, error) {
 					}, function(xhr, status, error) {
 						window.location.reload(true);
 						window.location.reload(true);
 					});
 					});