$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')");
}
}
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() {
}, 3000);
});
});
+
+ // Re-initialise the fancySelect
+ initFancySelect();
}
\ No newline at end of file
@color-header-grey: #2a3743;
@color-light-grey: #f3f3f3;
@color-error: #c91818;
+@color-submenu-hover: #e86f68;
//-- Content and breakpoints
@mobile-breakpoint: 1024px;
div.fancy-select {
position: relative;
- font-weight: 300;
font-size: inherit;
&.disabled {
}
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;
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
list-style: none;
margin: 0;
position: absolute;
- top: 105%;
+ top: 100%;
left: 0;
visibility: hidden;
opacity: 0;
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;
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*/
&.overflowing {
top: auto;
- bottom: 110%;
+ bottom: 105%;
&.open {
//transition: opacity, max-height 300ms ease-out;
}
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;
//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;
}
}
}
\r
&.active a, a:hover {\r
border-bottom-color: transparent;\r
- color: #e86f68;\r
+ color: @color-submenu-hover;\r
}\r
}\r
}\r
}
.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;
}