story submission: make tag select box match tag description too
fixes #247
This commit is contained in:
parent
850131873b
commit
b21f96cb1a
|
@ -182,6 +182,15 @@
|
|||
Lobsters.fetchURLTitle($(this), $("#story_url"), $("#story_title"));
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#story_tags_a").select2({
|
||||
formatSelection: function(what) {
|
||||
return what.id;
|
||||
},
|
||||
matcher: function(term, text, opt) {
|
||||
return (text.toLowerCase().indexOf(term.toLowerCase()) >= 0);
|
||||
},
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<% end %>
|
||||
|
|
|
@ -39,13 +39,7 @@
|
|||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
<% if @story.previewing %>
|
||||
$("#story_tags_a").select2({
|
||||
formatSelection: function(what) {
|
||||
return what.id;
|
||||
}
|
||||
});
|
||||
<% else %>
|
||||
<% if !@story.previewing %>
|
||||
$("#story_url").focus();
|
||||
<% end %>
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue