Skip to content

Commit

Permalink
#40 bugfix: do not loose current selection
Browse files Browse the repository at this point in the history
  • Loading branch information
M. Peter committed Oct 29, 2015
1 parent 38749d2 commit 3705100
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions _src/js/views/facets/subselect.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ class FacetSubsSelect extends require( "./base" )
reopen: ( pView )=>
if @_isFull()
return
# set the current values
_oldVals = @result.pluck( "value" )
@model.set( value: _oldVals )

# reset results and select2
pView.$results.empty()
@select2.$container.off()
@select2.destroy()
@result.reset()
@select2 = null

# set the current values
_oldVals = @result.pluck( "value" )
@model.set( value: _oldVals )

return super

_initSelect2: =>
Expand Down
6 changes: 3 additions & 3 deletions dist/js/iggy.js
Original file line number Diff line number Diff line change
Expand Up @@ -1330,10 +1330,10 @@
return this.selectCount <= 0 ? !1 : (this.result || []).length >= this.selectCount;
}, c.prototype.reopen = function(a) {
var b;
if (!this._isFull()) return a.$results.empty(), this.select2.$container.off(), this.select2.destroy(),
this.result.reset(), this.select2 = null, b = this.result.pluck("value"), this.model.set({
if (!this._isFull()) return b = this.result.pluck("value"), this.model.set({
value: b
}), c.__super__.reopen.apply(this, arguments);
}), a.$results.empty(), this.select2.$container.off(), this.select2.destroy(), this.result.reset(),
this.select2 = null, c.__super__.reopen.apply(this, arguments);
}, c.prototype._initSelect2 = function() {
var a;
return null == this.select2 && (a = _.extend({}, this.defaultModuleOpts, this.model.get("opts"), {
Expand Down
10 changes: 5 additions & 5 deletions js/iggy.debug.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions js/iggy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2254,15 +2254,15 @@ FacetSubsSelect = (function(superClass) {
if (this._isFull()) {
return;
}
_oldVals = this.result.pluck("value");
this.model.set({
value: _oldVals
});
pView.$results.empty();
this.select2.$container.off();
this.select2.destroy();
this.result.reset();
this.select2 = null;
_oldVals = this.result.pluck("value");
this.model.set({
value: _oldVals
});
return FacetSubsSelect.__super__.reopen.apply(this, arguments);
};

Expand Down

0 comments on commit 3705100

Please sign in to comment.