\
\
{{#facets}} \
\
@@ -57,9 +57,6 @@ my.Fields = Backbone.View.extend({
\
',
- events: {
- 'click .js-show-hide': 'onShowHide'
- },
initialize: function(model) {
var self = this;
this.el = $(this.el);
@@ -77,6 +74,7 @@ my.Fields = Backbone.View.extend({
self.model.getFieldsSummary();
self.render();
});
+ this.el.find('.collapse').collapse();
this.render();
},
render: function() {
@@ -91,25 +89,7 @@ my.Fields = Backbone.View.extend({
});
var templated = Mustache.render(this.template, tmplData);
this.el.html(templated);
- this.el.find('.collapse').collapse('hide');
- },
- onShowHide: function(e) {
- e.preventDefault();
- var $target = $(e.target);
- // weird collapse class seems to have been removed (can watch this happen
- // if you watch dom) but could not work why. Absence of collapse then meant
- // we could not toggle.
- // This seems to fix the problem.
- this.el.find('.accordion-body').addClass('collapse');;
- if ($target.text() === '+') {
- this.el.find('.collapse').collapse('show');
- $target.text('-');
- } else {
- this.el.find('.collapse').collapse('hide');
- $target.text('+');
- }
}
});
})(jQuery, recline.View);
-