|
|
|
|
@ -363,8 +363,9 @@ if (EXPO.profile){ |
|
|
|
|
|
|
|
|
|
if($avatar.length){ |
|
|
|
|
$avatar.attr('src', data.url); |
|
|
|
|
this.refreshState(); |
|
|
|
|
} |
|
|
|
|
$('.p-editable').removeClass('pe-current'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
@ -468,7 +469,8 @@ if (EXPO.profile){ |
|
|
|
|
$(function () { |
|
|
|
|
var $editables = $('.'+self.opt.editableClass), |
|
|
|
|
$country = $('#'+self.opt.selectBox[0].id), |
|
|
|
|
$city = $('#'+self.opt.selectBox[2].id); |
|
|
|
|
$city = $('#'+self.opt.selectBox[2].id), |
|
|
|
|
$companyUrl = $("#id_url"); |
|
|
|
|
|
|
|
|
|
$waiter = $('#wait-ajax').css({'z-index': '8012'}); |
|
|
|
|
/** |
|
|
|
|
@ -627,50 +629,62 @@ if (EXPO.profile){ |
|
|
|
|
self.forms[formName].refreshState(); |
|
|
|
|
return false; |
|
|
|
|
}); |
|
|
|
|
/** |
|
|
|
|
* edit button |
|
|
|
|
*/ |
|
|
|
|
$('.'+self.opt.editButtonClass+', .'+self.opt.avatarButtonClass, $wrapper).on('click', function () { |
|
|
|
|
//close other active editable forms
|
|
|
|
|
var $wrapper = $(this).closest('.'+self.opt.formWrapperClass), |
|
|
|
|
formId = $wrapper.find('.'+self.opt.updateFormClass).attr('id'), |
|
|
|
|
$description = $wrapper.find('.'+self.opt.descriptionClass), |
|
|
|
|
$editable = $wrapper.find('.'+self.opt.editableClass); |
|
|
|
|
$editables.each(function () { |
|
|
|
|
if($('.'+self.opt.avatarButtonClass).length){ |
|
|
|
|
/** |
|
|
|
|
* avatar image choose button |
|
|
|
|
*/ |
|
|
|
|
$('.'+self.opt.editButtonClass+','+' .'+self.opt.avatarButtonClass, $wrapper).on('click', function () { |
|
|
|
|
var $input = $('#'+self.opt.avatarInputId); |
|
|
|
|
$input.trigger('click'); |
|
|
|
|
return false; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
/** |
|
|
|
|
* edit button |
|
|
|
|
*/ |
|
|
|
|
$('.'+self.opt.editButtonClass+', .'+self.opt.avatarButtonClass, $wrapper).on('click', function () { |
|
|
|
|
//close other active editable forms
|
|
|
|
|
var $wrapper = $(this).closest('.'+self.opt.formWrapperClass), |
|
|
|
|
formId = $wrapper.find('.'+self.opt.updateFormClass).attr('id'), |
|
|
|
|
$description = $wrapper.find('.'+self.opt.descriptionClass), |
|
|
|
|
$editable = $wrapper.find('.'+self.opt.editableClass); |
|
|
|
|
if($(this).hasClass(self.opt.formCurrentClass)){ |
|
|
|
|
if(self.forms[formId].refrashable){ |
|
|
|
|
$editables.each(function () { |
|
|
|
|
var $wrapper = $(this).closest('.'+self.opt.formWrapperClass), |
|
|
|
|
formId = $wrapper.find('.'+self.opt.updateFormClass).attr('id'), |
|
|
|
|
$description = $wrapper.find('.'+self.opt.descriptionClass), |
|
|
|
|
$editable = $wrapper.find('.'+self.opt.editableClass); |
|
|
|
|
if($(this).hasClass(self.opt.formCurrentClass)){ |
|
|
|
|
if(self.forms[formId].refrashable){ |
|
|
|
|
|
|
|
|
|
self.forms[formId].refreshState(); |
|
|
|
|
$editable.removeClass(EXPO.company.opt.formCurrentClass); |
|
|
|
|
}else{ |
|
|
|
|
$editable.removeClass(self.opt.formCurrentClass); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
self.forms[formId].refreshState(); |
|
|
|
|
$editable.removeClass(EXPO.profile.opt.formCurrentClass); |
|
|
|
|
}else{ |
|
|
|
|
$editable.removeClass(self.opt.formCurrentClass); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
if(self.forms[formId].refrashable){ |
|
|
|
|
$editable.removeClass('hidden'); |
|
|
|
|
$description.addClass('hidden'); |
|
|
|
|
}else{ |
|
|
|
|
if(self.forms[formId].refrashable){ |
|
|
|
|
$editable.removeClass('hidden'); |
|
|
|
|
$description.addClass('hidden'); |
|
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
$editable.addClass(self.opt.formCurrentClass); |
|
|
|
|
$(document).on('click.form', function(event) { |
|
|
|
|
var targetObj = $(event.target); |
|
|
|
|
if (targetObj.parents().filter('.e-form').length < 1) { |
|
|
|
|
$editable.removeClass(self.opt.formCurrentClass); |
|
|
|
|
self.forms[formName].refreshState(); |
|
|
|
|
$(document).off('click.form'); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return false; |
|
|
|
|
$editable.addClass(self.opt.formCurrentClass); |
|
|
|
|
$(document).on('click.form', function(event) { |
|
|
|
|
var targetObj = $(event.target); |
|
|
|
|
if (targetObj.parents().filter('.e-form').length < 1) { |
|
|
|
|
$editable.removeClass(self.opt.formCurrentClass); |
|
|
|
|
self.forms[formName].refreshState(); |
|
|
|
|
$(document).off('click.form'); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
@ -682,7 +696,41 @@ if (EXPO.profile){ |
|
|
|
|
$.fancybox.open('#'+ self.opt.addCompany.modalId); |
|
|
|
|
return false; |
|
|
|
|
}); |
|
|
|
|
/** |
|
|
|
|
* add company url placeholder |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
$companyUrl.on('focus', function () { |
|
|
|
|
var $this = $(this), |
|
|
|
|
placeholder = self.opt.companyAddInputMask; |
|
|
|
|
|
|
|
|
|
if($.trim($this.val()) == ''){ |
|
|
|
|
$this.val(placeholder); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
}); |
|
|
|
|
$companyUrl.on('click', function () { |
|
|
|
|
if (this.setSelectionRange && $.trim($(this).val()) == self.opt.companyAddInputMask){ |
|
|
|
|
var len = $(this).val().length; |
|
|
|
|
this.setSelectionRange(len, len); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
$companyUrl.on('keypress', function () { |
|
|
|
|
var $this = $(this), |
|
|
|
|
placeholder = self.opt.companyAddInputMask; |
|
|
|
|
|
|
|
|
|
if($.trim($this.val()) == ''){ |
|
|
|
|
$this.val(placeholder); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
$companyUrl.on('blur', function () { |
|
|
|
|
var $this = $(this), |
|
|
|
|
placeholder = self.opt.companyAddInputMask; |
|
|
|
|
if($.trim($this.val()) == placeholder){ |
|
|
|
|
$this.val(''); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|