Created
April 18, 2012 19:45
-
-
Save da1nonly/2416044 to your computer and use it in GitHub Desktop.
js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
$('.metabox_submit').click(function(e) { | |
e.preventDefault(); | |
$('#publish').click(); | |
}); | |
$('#add-row').on('click', function() { | |
var row = $('.empty-row.screen-reader-text').clone(true); | |
row.removeClass('empty-row screen-reader-text'); | |
row.insertBefore('#repeatable-fieldset-one tbody>tr:last'); | |
return false; | |
}); | |
$('.remove-row').on('click', function() { | |
$(this).parents('tr').remove(); | |
return false; | |
}); | |
$('#repeatable-fieldset-one tbody').sortable({ | |
opacity: 0.6, | |
revert: true, | |
cursor: 'move', | |
handle: '.sort' | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment