|
|
|
@ -9,7 +9,7 @@ if (EXPO.profile){ |
|
|
|
EXPO.profile = (function() { |
|
|
|
EXPO.profile = (function() { |
|
|
|
// variables
|
|
|
|
// variables
|
|
|
|
var that = {}; |
|
|
|
var that = {}; |
|
|
|
that.settings = { |
|
|
|
that.opt = { |
|
|
|
updateFormClass:'update-profile-form' |
|
|
|
updateFormClass:'update-profile-form' |
|
|
|
}; //default module setting
|
|
|
|
}; //default module setting
|
|
|
|
//language object
|
|
|
|
//language object
|
|
|
|
@ -88,7 +88,7 @@ if (EXPO.profile){ |
|
|
|
$('#id_'+input, $('#'+self.formId)).value(self.formData[input]); |
|
|
|
$('#id_'+input, $('#'+self.formId)).value(self.formData[input]); |
|
|
|
} |
|
|
|
} |
|
|
|
if($('#static-'+input).length > 0){ |
|
|
|
if($('#static-'+input).length > 0){ |
|
|
|
$('#static-'+input).html |
|
|
|
$('#static-'+input).html(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -293,7 +293,7 @@ if (EXPO.profile){ |
|
|
|
that.init = function(options) { |
|
|
|
that.init = function(options) { |
|
|
|
$.extend(this.lang, options.lang); |
|
|
|
$.extend(this.lang, options.lang); |
|
|
|
options.lang = null; |
|
|
|
options.lang = null; |
|
|
|
$.extend(this.settings, options); |
|
|
|
$.extend(this.opt, options); |
|
|
|
|
|
|
|
|
|
|
|
var self = this, |
|
|
|
var self = this, |
|
|
|
initMaskedInput = function (inputId) { |
|
|
|
initMaskedInput = function (inputId) { |
|
|
|
@ -329,27 +329,27 @@ if (EXPO.profile){ |
|
|
|
//start of document.ready
|
|
|
|
//start of document.ready
|
|
|
|
|
|
|
|
|
|
|
|
// <selectbox> styling with 3-rd party libs
|
|
|
|
// <selectbox> styling with 3-rd party libs
|
|
|
|
$('#'+self.settings.selectBox[0].id).select2({ |
|
|
|
$('#'+self.opt.selectBox[0].id).select2({ |
|
|
|
width: 'element' |
|
|
|
width: 'element' |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
$('#'+self.settings.selectBox[1].id).select2({ |
|
|
|
$('#'+self.opt.selectBox[1].id).select2({ |
|
|
|
width: 'element', |
|
|
|
width: 'element', |
|
|
|
placeholder: self.settings.selectBox[1].placeholder, |
|
|
|
placeholder: self.opt.selectBox[1].placeholder, |
|
|
|
maximumSelectionSize: 3 |
|
|
|
maximumSelectionSize: 3 |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
$('#'+self.settings.selectBox[2].id).select2({ |
|
|
|
$('#'+self.opt.selectBox[2].id).select2({ |
|
|
|
placeholder: self.settings.selectBox[2].placeholder, |
|
|
|
placeholder: self.opt.selectBox[2].placeholder, |
|
|
|
width: 'element', |
|
|
|
width: 'element', |
|
|
|
ajax: { |
|
|
|
ajax: { |
|
|
|
|
|
|
|
|
|
|
|
url: self.settings.selectBox[2].path, |
|
|
|
url: self.opt.selectBox[2].path, |
|
|
|
dataType: "json", |
|
|
|
dataType: "json", |
|
|
|
quietMillis: 200, |
|
|
|
quietMillis: 200, |
|
|
|
|
|
|
|
|
|
|
|
data: function(term, page, country){ |
|
|
|
data: function(term, page, country){ |
|
|
|
var country = $('#'+self.settings.selectBox[0].id).val(); |
|
|
|
var country = $('#'+self.opt.selectBox[0].id).val(); |
|
|
|
return {term: term, |
|
|
|
return {term: term, |
|
|
|
page: page, |
|
|
|
page: page, |
|
|
|
country: country}; |
|
|
|
country: country}; |
|
|
|
@ -375,13 +375,13 @@ if (EXPO.profile){ |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
$('#'+self.settings.selectBox[3].id).select2({ |
|
|
|
$('#'+self.opt.selectBox[3].id).select2({ |
|
|
|
placeholder: self.settings.selectBox[3].placeholder, |
|
|
|
placeholder: self.opt.selectBox[3].placeholder, |
|
|
|
width: '200px', |
|
|
|
width: '200px', |
|
|
|
minimumInputLength: 1, |
|
|
|
minimumInputLength: 1, |
|
|
|
ajax: { |
|
|
|
ajax: { |
|
|
|
|
|
|
|
|
|
|
|
url: self.settings.selectBox[3].path, |
|
|
|
url: self.opt.selectBox[3].path, |
|
|
|
dataType: "json", |
|
|
|
dataType: "json", |
|
|
|
quietMillis: 200, |
|
|
|
quietMillis: 200, |
|
|
|
|
|
|
|
|
|
|
|
@ -408,13 +408,13 @@ if (EXPO.profile){ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// $('#'+ self.settings.phoneBox);
|
|
|
|
|
|
|
|
// make mask on phone field input
|
|
|
|
// make mask on phone field input
|
|
|
|
initMaskedInput(self.settings.phoneBox); |
|
|
|
initMaskedInput(self.opt.phoneBox); |
|
|
|
//forms init
|
|
|
|
//forms init
|
|
|
|
$('.'+self.settings.updateFormClass).each(function () { |
|
|
|
$('.'+self.opt.updateFormClass).each(function () { |
|
|
|
var formName = $(this).attr('id'), |
|
|
|
var formName = $(this).attr('id'), |
|
|
|
path = $(this).attr('action'), |
|
|
|
path = $(this).attr('action'), |
|
|
|
inputData; |
|
|
|
inputData; |
|
|
|
@ -438,6 +438,36 @@ if (EXPO.profile){ |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* edit button |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
$('.'+self.opt.editButtonClass).on('click', function () { |
|
|
|
|
|
|
|
var $switch = $(this), |
|
|
|
|
|
|
|
$wrapper = $switch.closest('.edit-wrap'), |
|
|
|
|
|
|
|
$container = $switch.closest('.p-editable'), |
|
|
|
|
|
|
|
$pForm = $wrapper.children('.e-form'), |
|
|
|
|
|
|
|
$closeBtn = $pForm.find('a.ef-close'), |
|
|
|
|
|
|
|
$eContainers = $('.p-editable.pe-current').not($container); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$eContainers.each(function() { |
|
|
|
|
|
|
|
$(this).removeClass('pe-current'); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
$container.toggleClass('pe-current'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$closeBtn.one('click', function() { |
|
|
|
|
|
|
|
$container.removeClass('pe-current'); |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(document).one('click', function(event) { |
|
|
|
|
|
|
|
var targetObj = $(event.target); |
|
|
|
|
|
|
|
if (targetObj.parents().filter('.e-form').length < 1) { |
|
|
|
|
|
|
|
$container.removeClass('pe-current'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|