expo-33 14 point

remotes/origin/1203
pavel 11 years ago
parent a9223f2ff2
commit f6249ee872
  1. 31
      templates/client/static_client/js/_modules/block.search.js

@ -245,6 +245,9 @@ if (EXPO.searchBlock){
} }
return false; return false;
}); });
/**
*
*/
// modal theme checkbox change behavior // modal theme checkbox change behavior
$checkBox.on('change', function (event, param) { $checkBox.on('change', function (event, param) {
var checkboxId = $(this).attr('id'), var checkboxId = $(this).attr('id'),
@ -439,11 +442,13 @@ if (EXPO.searchBlock){
* check particular checkbox input * check particular checkbox input
* @param {string} id * @param {string} id
* @param {string} name * @param {string} name
* @param {boolean} strict - if true then select particular checkbox without 'popping' to parent category
* @private * @private
*/ */
_checkCheckBox: function (id,name) { _checkCheckBox: function (id,name) {
var self = this, var self = this,
$chckBox; $chckBox;
if(name == 'th'){ if(name == 'th'){
$chckBox = $('#tid_'+id, self.$modalInst); $chckBox = $('#tid_'+id, self.$modalInst);
}else if(name == 'tg'){ }else if(name == 'tg'){
@ -1024,6 +1029,11 @@ if (EXPO.searchBlock){
//make fake checkbox active\passive //make fake checkbox active\passive
/**
* if modala is not in strict mode ( enable popping from children categories to parent)
*/
if(!self.strictMode){
if(this.checked){ if(this.checked){
//если выбраны все дочерние //если выбраны все дочерние
@ -1076,6 +1086,17 @@ if (EXPO.searchBlock){
} }
} }
}else{
if(this.checked){
selectItem(this);
refreshTags(this);
createTag(this);
}else{
unSelectItem(this);
refreshTags(this);
deleteTag(this);
}
}
triggerSetText(); triggerSetText();
}); });
/** /**
@ -1209,9 +1230,15 @@ if (EXPO.searchBlock){
* @param {number} id * @param {number} id
* @private * @private
*/ */
_checkCheckBox: function (id) { _checkCheckBox: function (id ,strict) {
var self = this, var self = this,
$chckBox = $('#id_'+id, self.$selfContainer); $chckBox = $('#id_'+id, self.$selfContainer);
if (strict){
this.strictMode = true;
}else{
this.strictMode = false;
}
if($chckBox.length && !$chckBox.prop('checked')){ if($chckBox.length && !$chckBox.prop('checked')){
$chckBox.prop('checked',true); $chckBox.prop('checked',true);
$chckBox.trigger('change'); $chckBox.trigger('change');
@ -2075,7 +2102,7 @@ if (EXPO.searchBlock){
EXPO.searchBlock.placesModal._loadParentTree(data, function(){ EXPO.searchBlock.placesModal._loadParentTree(data, function(){
EXPO.searchBlock.placesModal._checkCheckBox(id, name); EXPO.searchBlock.placesModal._checkCheckBox(id, true);
}); });
}); });
} else{ } else{

Loading…
Cancel
Save