Merge branch 'feature-newstyles' into develop
[snf-cloudcms] / cloudcms / static / cloudcms / js / common.js
index 33e1f7e..583b8f8 100644 (file)
@@ -18,8 +18,8 @@ function tableFixedCols(table, firstColWidth ){
        var ColWidth = parseFloat( (100 - firstColWidth)/ColsNum ).toFixed(0);\r
        var ColWidthPercentage = ColWidth+'%';\r
        var firstColWidthPercentage = firstColWidth+'%';\r
-       $('table th, table td').attr('width',ColWidthPercentage ); \r
-       $('table tr td:first-child, table tr th:first-child').attr('width',firstColWidthPercentage );\r
+       $('.projects table th, .projects  table td').attr('width',ColWidthPercentage ); \r
+       $('.projects table tr td:first-child,.projects  table tr th:first-child').attr('width',firstColWidthPercentage );\r
        \r
 }\r
 \r
@@ -83,9 +83,12 @@ if (navigator.userAgent.match(/iPhone/i)) {
        document.addEventListener("gesturestart", gestureStart, false);\r
 }\r
 //end of fix\r
+\r
   \r
 $(document).ready(function() {\r
    \r
+\r
+\r
     setContainerMinHeight('.container .wrapper');\r
     tableFixedCols('my-projects', 25);\r
        \r
@@ -153,8 +156,8 @@ $(document).ready(function() {
       function () {\r
        \r
         $(this).animate({\r
-           top: '+=-10'   \r
-           }, 600, function() {\r
+           top: '+=-3'   \r
+           }, 0, function() {\r
                if ($(this).find('img').attr('src').indexOf("_top") == -1) {\r
                        var src = $(this).find('img').attr('src').replace('.png', '_top.png')\r
                        $(this).find('img').attr("src", src);\r
@@ -327,8 +330,15 @@ $(document).ready(function() {
     });\r
          \r
        // fix for recaptcha fields\r
-       $('#okeanos_recaptcha').parents('.form-row').find('.extra-img').hide();             \r
+       $('#okeanos_recaptcha').parents('.form-row').find('.extra-img').hide();\r
+\r
+  fixEl = $('.details .lt');\r
+  if (fixEl.length){ window.fixEloffsetTop = fixEl.offset().top;} \r
+  \r
+\r
+  $(".stats-block li em").equalHeights();\r
 \r
\r
 });\r
        \r
 $(window).resize(function() {\r
@@ -336,4 +346,20 @@ $(window).resize(function() {
    setContainerMinHeight('.container .wrapper');\r
     \r
 \r
-});
\ No newline at end of file
+});\r
+\r
+\r
+/* js for fixed faq/userguide side nav */\r
+$(window).scroll(function () {\r
+\r
+  if ( $('.details .lt').height() < $('.details .rt').height() ) {\r
+    if ($(window).scrollTop() > window.fixEloffsetTop){ \r
+      fixEl.addClass('fixed');\r
+    } else {\r
+      fixEl.removeClass('fixed');\r
+    }\r
+  }\r
+\r
+\r
+\r
+});