Changing the async client slugify bit to only do its thing if the slug input is empty

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-07-24 01:14:24 -07:00
parent c6fc71e89d
commit e6ff7cc711

View File

@@ -18,8 +18,10 @@
//pull slug input from tab order
$("#<%: Html.FieldIdFor(m=>m.Slug)%>").attr("tabindex",-1);
$("#<%: Html.FieldIdFor(m=>m.Title)%>").blur(function(){
var slug = $("#<%:Html.FieldIdFor(m=>m.Slug)%>");
if (slug.val()) { return true; }
$(this).slugify({
target:$("#<%:Html.FieldIdFor(m=>m.Slug)%>"),
target:slug,
url:"<%: Url.Action("Slugify","Item",new RouteValueDictionary{{"Area","Routable"}})%>",
contentType:"<%: Model.ContentType %>",
id:"<%=Model.Id %>" <%if (Model.ContainerId != null) { %>,