From 93289f60dd84e73f65ec02afa25f0d200286a713 Mon Sep 17 00:00:00 2001 From: "alextselegidis@gmail.com" Date: Wed, 8 May 2013 16:48:26 +0000 Subject: [PATCH] =?UTF-8?q?=CE=9C=CE=B9=CE=BA=CF=81=CE=AD=CF=82=20=CE=B1?= =?UTF-8?q?=CE=BB=CE=BB=CE=B1=CE=B3=CE=AD=CF=82=20=CE=BA=CE=B1=CE=B9=20?= =?UTF-8?q?=CE=B2=CE=B5=CE=BB=CF=84=CE=B9=CF=8E=CF=83=CE=B5=CE=B9=CF=82=20?= =?UTF-8?q?=CF=83=CF=84=CE=BF=CE=BD=20=CE=BA=CF=8E=CE=B4=CE=B9=CE=BA=CE=B1?= =?UTF-8?q?=20=CF=84=CE=B7=CF=82=20=CF=83=CE=B5=CE=BB=CE=AF=CE=B4=CE=B1?= =?UTF-8?q?=CF=82=20=CE=BA=CF=81=CE=AC=CF=84=CE=B7=CF=83=CE=B7=CF=82=20?= =?UTF-8?q?=CF=81=CE=B1=CE=BD=CF=84=CE=B5=CE=B2=CE=BF=CF=8D.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/application/views/appointments/book.php | 6 +++-- src/assets/css/style.css | 1 - ...ook-appointment.js => book_appointment.js} | 0 src/assets/js/general_functions.js | 22 +++++++++++++++++++ 4 files changed, 26 insertions(+), 3 deletions(-) rename src/assets/js/frontend/{book-appointment.js => book_appointment.js} (100%) diff --git a/src/application/views/appointments/book.php b/src/application/views/appointments/book.php index 503b356e..7dcbb18a 100644 --- a/src/application/views/appointments/book.php +++ b/src/application/views/appointments/book.php @@ -16,7 +16,8 @@ - + + @@ -34,7 +35,8 @@ diff --git a/src/assets/css/style.css b/src/assets/css/style.css index 58480bc0..1128312d 100644 --- a/src/assets/css/style.css +++ b/src/assets/css/style.css @@ -14,7 +14,6 @@ body { ------------------------------------------------------------------------------ */ #book-appointment { width: 660px; - margin: 150px auto 0 auto; background: #FFF; box-shadow: 0px 1px 1px #B6B6B6; min-height: 480px; diff --git a/src/assets/js/frontend/book-appointment.js b/src/assets/js/frontend/book_appointment.js similarity index 100% rename from src/assets/js/frontend/book-appointment.js rename to src/assets/js/frontend/book_appointment.js diff --git a/src/assets/js/general_functions.js b/src/assets/js/general_functions.js index e9fc7c93..357ff292 100644 --- a/src/assets/js/general_functions.js +++ b/src/assets/js/general_functions.js @@ -61,3 +61,25 @@ GeneralFunctions.displayMessageBox = function(title, message, messageButtons) { jQuery("#message_box .ui-dialog-titlebar-close").hide(); } +/** + * This method centers a DOM element vertically and horizontally + * on the page. + * + * @param {object} elementHandle The object that is going to be + * centered. + */ +GeneralFunctions.centerElementOnPage = function(elementHandle) { + // Center main frame vertical middle + $(window).resize(function() { + var elementLeft = ($(window).width() - elementHandle.outerWidth()) / 2; + var elementTop = ($(window).height() - elementHandle.outerHeight()) / 2; + elementTop = (elementTop > 0 ) ? elementTop : 20; + + elementHandle.css({ + position : 'absolute', + left : elementLeft, + top : elementTop + }); + }); + $(window).resize(); +} \ No newline at end of file