Permalink
Browse files

Merge branch 'single-backstroke-delete' of https://github.com/toots/c…

…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...
2 parents 5a0a7eb + f61042d commit dc024d784ac1c1971fc968d519ed4ef3d9915f1c @pfiller pfiller committed May 26, 2012
View
@@ -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;
};
@@ -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");
+ }
}
};

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -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;
};
@@ -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");
+ }
}
};

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -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
@@ -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
@@ -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: ->

0 comments on commit dc024d7

Please sign in to comment.