I am currently using the jQuery slug plugin to create a header based project pool. This works great. What I do troube only updates the slug when the user clicks the edit link. Right now, when the edit link is called, the slug function is started, and it works fine, but when the "done" link is clicked, I need to find a way to disable the slug function. I hope this makes sense.
$('#edit_slug').click(function() {
$("#edit_project_name").stringToSlug({
getPut: '.project_slug',
hide: false
});
$('input.project_slug').show();
$('input.project_slug').next("span").remove().end();
$('#edit_slug').hide();
$('input.project_slug').after(" <a href='#' id='done_edit_slug'>Done</a>");
});
$('#done_edit_slug').live('click', function() {
$("#edit_project_name").stringToSlug().end();
$('input.project_slug').after("<strong><span>"+$('input.project_slug').val()+"</span></strong>");
$('input.project_slug').hide();
$('#done_edit_slug').remove().end();
$('#edit_slug').show();
});
I am not sure if this is the best way to do this, and I am open to ideas. Most importantly, I do not know how to end the function stringToSlug()when pressed #done_edit_slug.
Thank!
source
share