NIHVIVO-194. Added a close button with click event listener to the custom form addNew div.
This commit is contained in:
parent
52f45b2394
commit
1c3772a125
4 changed files with 39 additions and 7 deletions
|
@ -87,6 +87,16 @@ option {
|
||||||
margin-bottom: 1.25em;
|
margin-bottom: 1.25em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.close {
|
#content form a.close {
|
||||||
display: none; /* Hide if Javascript disabled. Javascript will show. */
|
float: right;
|
||||||
|
margin-right: 1em;
|
||||||
|
font-size: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content form a.close:link,
|
||||||
|
#content form a.close:visited {
|
||||||
|
/*display: none; Hide if Javascript disabled. Javascript will show. */
|
||||||
|
border-color: #FF7700;
|
||||||
|
color: #FF7700;
|
||||||
|
|
||||||
}
|
}
|
|
@ -135,7 +135,9 @@ var customForm = {
|
||||||
doAddFormStep1: function() {
|
doAddFormStep1: function() {
|
||||||
|
|
||||||
if (this.formSteps == 1) {
|
if (this.formSteps == 1) {
|
||||||
|
customForm.addNewLink.css('margin-bottom', '1em');
|
||||||
customForm.doAddFormStep2();
|
customForm.doAddFormStep2();
|
||||||
|
customForm.doClose();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -299,6 +301,7 @@ var customForm = {
|
||||||
hideFields: function(el) {
|
hideFields: function(el) {
|
||||||
// Clear any input, so if we reshow the element the input won't still be there.
|
// Clear any input, so if we reshow the element the input won't still be there.
|
||||||
customForm.clearFields(el);
|
customForm.clearFields(el);
|
||||||
|
customForm.toggleRequiredHints('remove', el);
|
||||||
el.hide();
|
el.hide();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -325,14 +328,31 @@ var customForm = {
|
||||||
customForm.addNewLink.unbind('click');
|
customForm.addNewLink.unbind('click');
|
||||||
customForm.addNewLink.bind('click', function() {
|
customForm.addNewLink.bind('click', function() {
|
||||||
$(this).hide();
|
$(this).hide();
|
||||||
|
|
||||||
// Make sure to clear out what's in the existing select element,
|
// Make sure to clear out what's in the existing select element,
|
||||||
// else it could be submitted even when hidden.
|
// else it could be submitted even when hidden.
|
||||||
|
// RY When we have multiple existing and addNew divs, we won't
|
||||||
|
// show/hide them all, only the siblings of the addNewLink.
|
||||||
customForm.hideFields(customForm.existing);
|
customForm.hideFields(customForm.existing);
|
||||||
customForm.showFields(customForm.addNew);
|
customForm.showFields(customForm.addNew);
|
||||||
|
|
||||||
if (buttonText) {
|
if (buttonText) {
|
||||||
customForm.button.val(buttonText);
|
customForm.button.val(buttonText);
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
doClose: function() {
|
||||||
|
// This can be bound once on page load, doesn't need to be unbound
|
||||||
|
// or rebound.
|
||||||
|
customForm.close.click(function() {
|
||||||
|
// RY When we have multiple existing and addNew divs, we won't
|
||||||
|
// show/hide them all, only the siblings of the addNewLink.
|
||||||
|
customForm.showFields(customForm.existing);
|
||||||
|
customForm.hideFields(customForm.addNew);
|
||||||
|
customForm.addNewLink.show();
|
||||||
|
return false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -381,8 +381,10 @@ core:organizationGrantingDegree (EducationalBackground : Organization) - no inve
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="new">
|
<div class="new">
|
||||||
|
<a class="close" href="#">close</a>
|
||||||
<h6>Add a New Organization</h6>
|
<h6>Add a New Organization</h6>
|
||||||
<v:input type="text" label="Organization Name" labelClass="required" id="newOrgName" />
|
|
||||||
|
<v:input type="text" label="Organization Name" labelClass="required" id="newOrgName" size="30" />
|
||||||
<v:input type="select" label="Select Organization Type" labelClass="required" id="newOrgType" />
|
<v:input type="select" label="Select Organization Type" labelClass="required" id="newOrgType" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -318,7 +318,7 @@
|
||||||
|
|
||||||
<div class="new">
|
<div class="new">
|
||||||
<h6>Add a New Organization</h6>
|
<h6>Add a New Organization</h6>
|
||||||
<v:input type="text" label="Organization Name" labelClass="required" id="newOrgName" />
|
<v:input type="text" label="Organization Name" labelClass="required" id="newOrgName" size="30" />
|
||||||
<v:input type="select" label="Select Organization Type" labelClass="required" id="newOrgType" />
|
<v:input type="select" label="Select Organization Type" labelClass="required" id="newOrgType" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue