Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.

Commit

Permalink
Merge branch 'single-backstroke-delete' of https://github.com/toots/c…
Browse files Browse the repository at this point in the history
…hosen into toots-single-backstroke-delete

Conflicts:
	chosen/chosen.jquery.js
	chosen/chosen.jquery.min.js
	chosen/chosen.proto.js
	chosen/chosen.proto.min.js
  • Loading branch information
Patrick Filler committed May 26, 2012
2 parents 5a0a7eb + f61042d commit dc024d7
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 6 deletions.
7 changes: 6 additions & 1 deletion chosen/chosen.jquery.js
Expand Up @@ -131,6 +131,7 @@ Copyright (c) 2011 by Harvest
this.disable_search_threshold = this.options.disable_search_threshold || 0;
this.search_contains = this.options.search_contains || false;
this.choices = 0;
this.single_backstroke_delete = this.options.single_backstroke_delete || false;
return this.max_selected_options = this.options.max_selected_options || Infinity;
};

Expand Down Expand Up @@ -909,7 +910,11 @@ Copyright (c) 2011 by Harvest
return this.clear_backstroke();
} else {
this.pending_backstroke = this.search_container.siblings("li.search-choice").last();
return this.pending_backstroke.addClass("search-choice-focus");
if (this.single_backstroke_delete) {
return this.keydown_backstroke();
} else {
return this.pending_backstroke.addClass("search-choice-focus");
}
}
};

Expand Down
2 changes: 1 addition & 1 deletion chosen/chosen.jquery.min.js

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion chosen/chosen.proto.js
Expand Up @@ -131,6 +131,7 @@ Copyright (c) 2011 by Harvest
this.disable_search_threshold = this.options.disable_search_threshold || 0;
this.search_contains = this.options.search_contains || false;
this.choices = 0;
this.single_backstroke_delete = this.options.single_backstroke_delete || false;
return this.max_selected_options = this.options.max_selected_options || Infinity;
};

Expand Down Expand Up @@ -914,7 +915,11 @@ Copyright (c) 2011 by Harvest
return this.clear_backstroke();
} else {
this.pending_backstroke = this.search_container.siblings("li.search-choice").last();
return this.pending_backstroke.addClassName("search-choice-focus");
if (this.single_backstroke_delete) {
return this.keydown_backstroke();
} else {
return this.pending_backstroke.addClassName("search-choice-focus");
}
}
};

Expand Down
2 changes: 1 addition & 1 deletion chosen/chosen.proto.min.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion coffee/chosen.jquery.coffee
Expand Up @@ -498,7 +498,10 @@ class Chosen extends AbstractChosen
this.clear_backstroke()
else
@pending_backstroke = @search_container.siblings("li.search-choice").last()
@pending_backstroke.addClass "search-choice-focus"
if @single_backstroke_delete
@keydown_backstroke()
else
@pending_backstroke.addClass "search-choice-focus"

clear_backstroke: ->
@pending_backstroke.removeClass "search-choice-focus" if @pending_backstroke
Expand Down
5 changes: 4 additions & 1 deletion coffee/chosen.proto.coffee
Expand Up @@ -495,7 +495,10 @@ class Chosen extends AbstractChosen
this.clear_backstroke()
else
@pending_backstroke = @search_container.siblings("li.search-choice").last()
@pending_backstroke.addClassName("search-choice-focus")
if @single_backstroke_delete
@keydown_backstroke()
else
@pending_backstroke.addClassName("search-choice-focus")

clear_backstroke: ->
@pending_backstroke.removeClassName("search-choice-focus") if @pending_backstroke
Expand Down
1 change: 1 addition & 0 deletions coffee/lib/abstract-chosen.coffee
Expand Up @@ -31,6 +31,7 @@ class AbstractChosen
@disable_search_threshold = @options.disable_search_threshold || 0
@search_contains = @options.search_contains || false
@choices = 0
@single_backstroke_delete = @options.single_backstroke_delete || false
@max_selected_options = @options.max_selected_options || Infinity

set_default_text: ->
Expand Down

0 comments on commit dc024d7

Please sign in to comment.