Commit 76fd9dfa by attiyaishaque Committed by Attiya Ishaque

EDUCATOR-756 Instructor form data cleared on cancel.

parent 0627d608
......@@ -51,6 +51,9 @@ $(document).ready(function(){
function closeModal(event, modal) {
event.preventDefault();
if (modal.attr('id') == 'addInstructorModal') {
resetInstructorModalData();
}
modal.hide();
$('body').removeClass('stopScroll');
}
......@@ -87,3 +90,14 @@ function assignData(element, data){
$(element).attr("href", data);
$(element + '_copy').html(data);
}
function resetInstructorModalData() {
var imgPath = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==',
selectors = ['#given-name', '#family-name', '#title', '#email', '#bio', '#facebook', '#twitter', '#blog', '#majorWorks'];
$('#addInstructorModal div img').attr('src',imgPath);
for (var i in selectors) clearData(selectors[i]);
}
function clearData(selector){
$('#addInstructorModal div '+ selector).val('');
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment