]> _ Git - fluidbook-v3.git/commitdiff
Done #554 @2.5
authorstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 19 Jul 2016 12:07:15 +0000 (12:07 +0000)
committerstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 19 Jul 2016 12:07:15 +0000 (12:07 +0000)
framework/application/controllers/AjaxController.php
js/315-quote.js
less/001-variables.less
less/005-fancyselect.less
less/104-nav.less
less/315-quote.less

index c82be1f3b3a8358c9bd63c0e96b18849cbd8e6f2..a834f5a6f1a464782fdd8b4355ca858d5e81e896 100644 (file)
@@ -25,7 +25,7 @@ class AjaxController extends CubeIT_Controller_AjaxController {
                        $this->_datas->addReplace('#'. $formID, '<div id="confirmationQuote">' . $okmessage . '</div>');
                } else {
                        $this->_datas->refreshForm($form); // Respond with validation errors
-                       $this->_datas->addAction('eval', 'displayErrors()');
+                       $this->_datas->addAction('eval', "displayErrors('$formID')");
                }
 
        }
index 58d95974e224e88ccc20186e927d90fdbab0dc31..db33dabb77dc4efab886a4f9b5bcb0d72e9c260b 100644 (file)
@@ -1,16 +1,24 @@
 registerLoader(load_quoteform, true);
 
 function load_quoteform() {
-    $('#requestQuote select').fancySelect();
+
+    initFancySelect();
+
+    $(window).on('cubeitopenpopup', function() {
+        initFancySelect();
+    });
 }
 
+function initFancySelect() {
+    $('#requestQuote select, #requestQuotePopup select').fancySelect();
+}
 
-function displayErrors() {
+function displayErrors(formID) {
 
     var errors = [];
 
     // Collect errors from the form
-    $('.errormessage').each(function () {
+    $('#' + formID + ' .errormessage').each(function () {
         errors.push($(this).text());
 
         $('.validation-messages').html(errors.join('<br>')).fadeIn(500, function() {
@@ -19,4 +27,7 @@ function displayErrors() {
             }, 3000);
         });
     });
+
+    // Re-initialise the fancySelect
+    initFancySelect();
 }
\ No newline at end of file
index f442cca60bda281f3dda24a850a10f227e2ac689..d94d54c32f9e12153e585f066b0e74f0c110fd4b 100644 (file)
@@ -19,6 +19,7 @@
 @color-header-grey: #2a3743;
 @color-light-grey: #f3f3f3;
 @color-error: #c91818;
+@color-submenu-hover: #e86f68;
 
 //-- Content and breakpoints
 @mobile-breakpoint: 1024px;
index 5dd410d1b497202d631ce667732c0b0b6c68a517..ba2cd2e35a61c3ebb5d5ac9443381dd08ba7f241 100644 (file)
@@ -2,7 +2,6 @@
 
 div.fancy-select {
   position: relative;
-  font-weight: 300;
   font-size: inherit;
 
   &.disabled {
@@ -14,13 +13,13 @@ div.fancy-select {
   }
 
   select:focus + div.trigger.open {
-    box-shadow: none;
+    box-shadow: inset 0 -4px 0 #c2c4c7;
   }
 
   div.trigger {
     box-sizing: content-box; // To match other input elements
     cursor: pointer;
-    padding: 0 2.2em 0 0.4em;
+    padding: 0 3.4em 0 1em;
     line-height: 3.4;
     min-height: 3.4em;
     white-space: nowrap;
@@ -29,12 +28,12 @@ div.fancy-select {
     position: relative;
     background: #fff;
     border: 1px solid #000;
-    color: #aaa; // Placeholder text
+    color: #000; // Placeholder text
     z-index: 2;
     transition: all 140ms ease-out;
 
     &.selected {
-      color: #323232;
+      color: #000;
     }
 
     // Arrow
@@ -65,7 +64,7 @@ div.fancy-select {
     list-style: none;
     margin: 0;
     position: absolute;
-    top: 105%;
+    top: 100%;
     left: 0;
     visibility: hidden;
     opacity: 0;
@@ -74,7 +73,7 @@ div.fancy-select {
     max-height: 12.8em;
     width: 100%;
     overflow: auto;
-    background: #f8f8f8;
+    background: #fff;
     //border-top: 1px solid #7DD8D2;
     box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
     transition: all 150ms ease-out;
@@ -83,7 +82,7 @@ div.fancy-select {
       z-index: 10;
       visibility: visible;
       opacity: 1;
-      max-height: 12.8em; // Each item is 80% of 2em high. We want to show 8 so: 8*2*0.8 = 12.8
+      max-height: 12em; // Each item is 3em high. We want to show 4 so: 4*3 = 12
 
       /* have to use a non-visibility transition to prevent this iOS issue (bug?): */
       /*http://stackoverflow.com/questions/10736478/css-animation-visibility-visible-works-on-chrome-and-safari-but-not-on-ios*/
@@ -92,7 +91,7 @@ div.fancy-select {
 
     &.overflowing {
       top: auto;
-      bottom: 110%;
+      bottom: 105%;
 
       &.open {
         //transition: opacity, max-height 300ms ease-out;
@@ -100,10 +99,9 @@ div.fancy-select {
     }
 
     li {
-      font-size: 80%;
-      line-height: 2;
-      padding: 0 12px;
-      color: #323232;
+      line-height: 3;
+      padding: 0 1em;
+      color: @color-text;
       cursor: pointer;
       white-space: nowrap;
       text-overflow: ellipsis;
@@ -111,13 +109,11 @@ div.fancy-select {
       //transition: all 100ms ease-out;
 
       &.selected {
-        background: rgba(200,200,200,0.3);
-        color: #000;
+        color: @color-submenu-hover;
       }
 
       &.hover {
-        background: #ddd;
-        color: #000;
+        color: @color-submenu-hover;
       }
     }
   }
index f6f02fe64fe2ad78b5ff6a022d5c71a863f4ef68..ddaed5fb093f6c241fd4be3ab1b14e1b899585b5 100644 (file)
@@ -120,7 +120,7 @@ nav#menu {
 \r
                                        &.active a, a:hover {\r
                                                border-bottom-color: transparent;\r
-                                               color: #e86f68;\r
+                                               color: @color-submenu-hover;\r
                                        }\r
                                }\r
                        }\r
index e42444b0891cb7984fe3ec1c93176935fc9c21b6..45aaa425f22039098b6769a23da7a6d275aa778b 100644 (file)
        }
 
        .error {
-               input[type="text"], input[type="email"], select {
+               input[type="text"], input[type="email"], select, .trigger {
                        border-color: @color-text;
                        box-shadow: inset 0 -4px 0 @color-error;
                }