Skip to content

Commit fb13dec

Browse files
committed
add option to hide earch button + expose object parameters
1 parent 0049128 commit fb13dec

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

jquery.filters.js

+18-6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
showSingleFilterStatus = 'show-single',
1313
title;
1414

15+
$.bootstrapFilter = {
16+
filterModal: {}
17+
};
18+
1519

1620
var filterModal = {
1721
that: null,
@@ -29,7 +33,8 @@
2933
maxElementsInMultiBox: 3,
3034
dateFormat: dateTimeFormat,
3135
selectBoxHeight: 180,
32-
borderColor: '#ddd'
36+
borderColor: '#ddd',
37+
showSearchButton: true,
3338
}, options);
3439

3540
filterModal.that = this;
@@ -40,6 +45,7 @@
4045
renderRateRangeIfNeeded();
4146
bindFilterClicks();
4247
populateModal();
48+
exposeFilterModal();
4349

4450
return this;
4551
};
@@ -48,12 +54,16 @@
4854
filterModal.that.bootstrapFilter(filterModal.settings);
4955
};
5056

57+
function exposeFilterModal(){
58+
$.bootstrapFilter.filterModal = filterModal;
59+
}
60+
5161
/////////////// html rendering here ////////////////////
5262
function buildHtml(settings){
5363

5464
var selectedFiltersHtml,
5565
filterInternalHtml,
56-
searchButton,
66+
searchButton = '',
5767
selectedFilters;
5868

5969
// External Style
@@ -67,10 +77,12 @@
6777
//building the filters html
6878
filterInternalHtml = buildFiltersHtml();
6979

70-
searchButton = '<div class="clearfix"></div>' +
71-
'<div class="row" style="float: right; margin-top: 20px;">' +
72-
'<button id="filter-search-button" style="padding: 10px 112px" class="btn btn-lg btn-block btn-success">Search</button>' +
73-
'</div> ';
80+
if (filterModal.settings.showSearchButton) {
81+
searchButton = '<div class="clearfix"></div>' +
82+
'<div class="row" style="float: right; margin-top: 20px;">' +
83+
'<button id="filter-search-button" style="padding: 10px 112px" class="btn btn-lg btn-block btn-success">Search</button>' +
84+
'</div> ';
85+
}
7486

7587
title = '<legend>'+ settings.title+'</legend>';
7688

0 commit comments

Comments
 (0)