You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by hn...@apache.org on 2017/11/07 13:14:34 UTC

[myfaces-tobago] branch master updated: TOBAGO-1821 Update bootstrap datepicker library * positioning for datepicker: margin on can be ignored * as a side effect of removing position:relative from : tobago-page-menuStore don't need a margin; dropdown menus are positioned correctly

This is an automated email from the ASF dual-hosted git repository.

hnoeth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/master by this push:
     new 3d2436a  TOBAGO-1821 Update bootstrap datepicker library * positioning for datepicker: margin on <body> can be ignored * as a side effect of removing position:relative from <body>: tobago-page-menuStore don't need a margin; dropdown menus are positioned correctly
3d2436a is described below

commit 3d2436af1293c120ab1ff78f8bfb4aa0ddd9a6d1
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Tue Nov 7 14:14:24 2017 +0100

    TOBAGO-1821 Update bootstrap datepicker library
    * positioning for datepicker: margin on <body> can be ignored
    * as a side effect of removing position:relative from <body>: tobago-page-menuStore don't need a margin; dropdown menus are positioned correctly
---
 .../standard/tobago-bootstrap/_version/js/tobago-calendar.js  | 11 +++++------
 .../standard/tobago-bootstrap/_version/js/tobago-layout.js    |  4 ----
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/tobago/standard/tobago-bootstrap/_version/js/tobago-calendar.js b/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/tobago/standard/tobago-bootstrap/_version/js/tobago-calendar.js
index 945daed..b9e60eb 100644
--- a/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/tobago/standard/tobago-bootstrap/_version/js/tobago-calendar.js
+++ b/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/tobago/standard/tobago-bootstrap/_version/js/tobago-calendar.js
@@ -94,16 +94,13 @@ Tobago.DateTime.init = function (elements) {
           }
         });
 
-        /*
-         XXX need for fixing wrong positioning of bootstrap datepicker.
-         See https://github.com/Eonasdan/bootstrap-datetimepicker/issues/790 for more information.
-         */
+        // set position
         $date.parent().on('dp.show', function () {
           var datepicker = jQuery('.bootstrap-datetimepicker-widget');
           var $div = jQuery(this);
           var top, left;
           if (datepicker.hasClass('bottom')) {
-            top = $div.offset().top + $div.outerHeight() - jQuery("body").offset().top;
+            top = $div.offset().top + $div.outerHeight();
             left = $div.offset().left;
             datepicker.css({
               'top': top + 'px',
@@ -112,7 +109,7 @@ Tobago.DateTime.init = function (elements) {
             });
           }
           else if (datepicker.hasClass('top')) {
-            top = $div.offset().top - datepicker.outerHeight() - jQuery("body").offset().top;
+            top = $div.offset().top - datepicker.outerHeight();
             left = $div.offset().left;
             datepicker.css({
               'top': top + 'px',
@@ -122,6 +119,8 @@ Tobago.DateTime.init = function (elements) {
           }
           Tobago.DateTime.addPastClass($date);
         });
+
+        // set css class in update - like changing the month
         $date.parent().on('dp.update', function () {
           Tobago.DateTime.addPastClass($date);
         });
diff --git a/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/tobago/standard/tobago-bootstrap/_version/js/tobago-layout.js b/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/tobago/standard/tobago-bootstrap/_version/js/tobago-layout.js
index d75457e..ba74f04 100644
--- a/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/tobago/standard/tobago-bootstrap/_version/js/tobago-layout.js
+++ b/tobago-theme/tobago-theme-standard/src/main/resources/META-INF/resources/tobago/standard/tobago-bootstrap/_version/js/tobago-layout.js
@@ -51,10 +51,6 @@ var setMargins = function (body, headers, footers, currentHeaderHeight, currentF
 
   if (maxHeaderHeight > 0) {
     body.css("margin-top", maxHeaderHeight + "px");
-
-    // remove margin from page menu store; positioning of dropdowns
-    var pageMenuStore = Tobago.Utils.selectWithJQuery(body, ".tobago-page-menuStore");
-    pageMenuStore.css("margin-top", "-" + maxHeaderHeight + "px");
   }
   if (maxFooterHeight > 0) {
     body.css("margin-bottom", maxFooterHeight + "px");

-- 
To stop receiving notification emails like this one, please contact
['"commits@myfaces.apache.org" <co...@myfaces.apache.org>'].