|
|
|
|
@ -349,13 +349,6 @@ if (EXPO.company){ |
|
|
|
|
this.refreshState(); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
//$input.on('keypress', function (e) {
|
|
|
|
|
// var keycode = (e.keyCode ? e.keyCode : e.which);
|
|
|
|
|
// if(keycode == '13'){
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
//});
|
|
|
|
|
|
|
|
|
|
this.ajaxPath = path; |
|
|
|
|
|
|
|
|
|
@ -449,18 +442,42 @@ if (EXPO.company){ |
|
|
|
|
|
|
|
|
|
this.forms = {}; |
|
|
|
|
$(function () { |
|
|
|
|
var $editables = $('.'+self.opt.editableClass); |
|
|
|
|
var $editables = $('.'+self.opt.editableClass), |
|
|
|
|
$country = $('#'+self.opt.selectBox[0].id), |
|
|
|
|
$city = $('#'+self.opt.selectBox[1].id); |
|
|
|
|
//start of document.ready
|
|
|
|
|
$waiter = $('#wait-ajax').css({'z-index': '8012'}); |
|
|
|
|
/** |
|
|
|
|
* <selectbox> styling with 3-rd party libs |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* select country |
|
|
|
|
*/ |
|
|
|
|
$country.select2({ |
|
|
|
|
width: 'element', |
|
|
|
|
placeholder:self.opt.selectBox[0].placeholder |
|
|
|
|
}); |
|
|
|
|
/** |
|
|
|
|
* enable city <select/> when country is chosen |
|
|
|
|
*/ |
|
|
|
|
//todo:чтобы работал надо ждать пока Назар сделает нулевой option
|
|
|
|
|
|
|
|
|
|
$('#'+self.opt.selectBox[0].id).select2({ |
|
|
|
|
width: 'element' |
|
|
|
|
$country.on('change', function () { |
|
|
|
|
if($(this).val() != 0 || $(this).val() != ''){ |
|
|
|
|
$city.prop('disabled', false); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
$('#'+self.opt.selectBox[1].id).select2({ |
|
|
|
|
/** |
|
|
|
|
* select city inside country |
|
|
|
|
*/ |
|
|
|
|
/** |
|
|
|
|
* disable city <select/> if country is not chosen |
|
|
|
|
*/ |
|
|
|
|
if($country.val() == 0 || $country.val() == ''){ |
|
|
|
|
$city.prop('disabled', true); |
|
|
|
|
} |
|
|
|
|
$city.select2({ |
|
|
|
|
placeholder: self.opt.selectBox[1].placeHolder, |
|
|
|
|
width: 'element', |
|
|
|
|
ajax: { |
|
|
|
|
@ -470,7 +487,7 @@ if (EXPO.company){ |
|
|
|
|
quietMillis: 200, |
|
|
|
|
|
|
|
|
|
data: function(term, page, country){ |
|
|
|
|
var country = $('#'+self.opt.selectBox[0].id).val() |
|
|
|
|
var country = $('#'+self.opt.selectBox[0].id).val(); |
|
|
|
|
return {term: term, |
|
|
|
|
page: page, |
|
|
|
|
country: country}; |
|
|
|
|
@ -488,14 +505,16 @@ if (EXPO.company){ |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
initSelection : function(element, callback) { |
|
|
|
|
var id= $(element).val(); |
|
|
|
|
var id= $.trim($(element).val()); |
|
|
|
|
var text = $(element).attr('data-init-text'); |
|
|
|
|
callback({id: id, text:text}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* tags |
|
|
|
|
*/ |
|
|
|
|
$('#'+self.opt.selectBox[2].id).val('0'); |
|
|
|
|
$('#'+self.opt.selectBox[2].id).select2({ |
|
|
|
|
placeholder: self.opt.selectBox[2].placeholder, |
|
|
|
|
|