Fix Bug 38666 - When searching no specific region should be highlighted in the map
Clicking again on a region deselect it When searching, remove selection from regions. Change-Id: Ife70639a864f9d13d02406d1229316782a32ed3c
This commit is contained in:
committed by
Amir E. Aharoni
parent
3f4b5e4540
commit
0ace474b01
@@ -115,8 +115,14 @@
|
|||||||
that.$languageFilter.languagefilter( {
|
that.$languageFilter.languagefilter( {
|
||||||
$target: lcd,
|
$target: lcd,
|
||||||
languages: that.languages,
|
languages: that.languages,
|
||||||
success: $.proxy( that.success, that ),
|
success: function() {
|
||||||
noresults: $.proxy( that.noresults, that ),
|
$( '.regionselector' ).removeClass( 'active' );
|
||||||
|
that.success();
|
||||||
|
},
|
||||||
|
noresults: function() {
|
||||||
|
$( '.regionselector' ).removeClass( 'active' );
|
||||||
|
that.noresults();
|
||||||
|
},
|
||||||
searchAPI: that.options.searchAPI,
|
searchAPI: that.options.searchAPI,
|
||||||
onSelect: $.proxy( that.onSelect, that )
|
onSelect: $.proxy( that.onSelect, that )
|
||||||
} );
|
} );
|
||||||
@@ -129,6 +135,9 @@
|
|||||||
// clear the search field.
|
// clear the search field.
|
||||||
that.$languageFilter.val( '' );
|
that.$languageFilter.val( '' );
|
||||||
that.success();
|
that.success();
|
||||||
|
},
|
||||||
|
noresult: function() {
|
||||||
|
that.$languageFilter.languagefilter( 'clear' );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
|||||||
@@ -325,9 +325,14 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
click: function( e ) {
|
click: function( e ) {
|
||||||
e.stopPropagation();
|
if( this.$element.hasClass( 'active' ) ) {
|
||||||
e.preventDefault();
|
this.$element.removeClass( 'active' );
|
||||||
this.show();
|
if ( this.options.noresult ) {
|
||||||
|
this.options.noresult.call();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -351,6 +356,7 @@
|
|||||||
$.fn.regionselector.defaults = {
|
$.fn.regionselector.defaults = {
|
||||||
$target: null, // Where to render the results
|
$target: null, // Where to render the results
|
||||||
success: null, // callback if any results found.
|
success: null, // callback if any results found.
|
||||||
|
noresult: null, // callback when no results to show
|
||||||
languages: null
|
languages: null
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user