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"));
|
Lobsters.fetchURLTitle($(this), $("#story_url"), $("#story_title"));
|
||||||
return false;
|
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>
|
</script>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -39,13 +39,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
<% if @story.previewing %>
|
<% if !@story.previewing %>
|
||||||
$("#story_tags_a").select2({
|
|
||||||
formatSelection: function(what) {
|
|
||||||
return what.id;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
<% else %>
|
|
||||||
$("#story_url").focus();
|
$("#story_url").focus();
|
||||||
<% end %>
|
<% end %>
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue