summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/modules/custom-post-types/js/nova-drag-drop.js')
-rw-r--r--plugins/jetpack/modules/custom-post-types/js/nova-drag-drop.js54
1 files changed, 0 insertions, 54 deletions
diff --git a/plugins/jetpack/modules/custom-post-types/js/nova-drag-drop.js b/plugins/jetpack/modules/custom-post-types/js/nova-drag-drop.js
deleted file mode 100644
index 558d4651..00000000
--- a/plugins/jetpack/modules/custom-post-types/js/nova-drag-drop.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/* jshint onevar: false, smarttabs: true */
-/* global _novaDragDrop */
-
-(function($){
- var list;
-
- function init() {
- list = $('#the-list');
- dragMenus();
- addNonce();
- addSubmitButton();
- changeToPost();
- }
-
- function dragMenus() {
- list.sortable({
- cancel: '.no-items',
- stop: function( event, ui ) {
- if ( ui.item.is(':first-child') ) {
- return list.sortable('cancel');
- }
- //
- reOrder();
- }
- });
- }
-
- function reOrder() {
- list.find('.menu-label-row').each(function() {
- var term_id = $(this).data('term_id');
- $(this).nextUntil('.menu-label-row').each(function(i) {
- var row = $(this);
- row.find('.menu-order-value').val(i);
- row.find('.nova-menu-term').val(term_id);
- });
- });
- }
-
- function addSubmitButton() {
- $('.tablenav').prepend('<input type="submit" class="button-primary button-reorder alignright" value="' + _novaDragDrop.reorder + '" name="' + _novaDragDrop.reorderName + '" />');
- }
-
- function addNonce() {
- $('#posts-filter').append('<input type="hidden" name="' + _novaDragDrop.nonceName + '" value="' + _novaDragDrop.nonce + '" />');
- }
-
- function changeToPost() {
- $( '#posts-filter' ).attr( 'method', 'post' );
- }
-
- // do it
- $(document).ready(init);
-})(jQuery);
-