Nav Menus: Delegate click events for move links.

props ankit.gade.
fixes #25594.


git-svn-id: https://develop.svn.wordpress.org/trunk@26613 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-12-04 17:09:20 +00:00
parent 2d5ebb65fc
commit 1913b4c665
1 changed files with 10 additions and 8 deletions

View File

@ -379,27 +379,29 @@ var wpNavMenu;
},
initAccessibility : function() {
var menu = $( '#menu-to-edit' );
api.refreshKeyboardAccessibility();
api.refreshAdvancedAccessibility();
// Events
$( '.menus-move-up' ).on( 'click', function ( e ) {
menu.on( 'click', '.menus-move-up', function ( e ) {
api.moveMenuItem( $( this ).parents( 'li.menu-item' ).find( 'a.item-edit' ), 'up' );
e.preventDefault();
});
$( '.menus-move-down' ).on( 'click', function ( e ) {
})
menu.on( 'click', '.menus-move-down', function ( e ) {
api.moveMenuItem( $( this ).parents( 'li.menu-item' ).find( 'a.item-edit' ), 'down' );
e.preventDefault();
});
$( '.menus-move-top' ).on( 'click', function ( e ) {
})
menu.on( 'click', '.menus-move-top', function ( e ) {
api.moveMenuItem( $( this ).parents( 'li.menu-item' ).find( 'a.item-edit' ), 'top' );
e.preventDefault();
});
$( '.menus-move-left' ).on( 'click', function ( e ) {
})
menu.on( 'click', '.menus-move-left', function ( e ) {
api.moveMenuItem( $( this ).parents( 'li.menu-item' ).find( 'a.item-edit' ), 'left' );
e.preventDefault();
});
$( '.menus-move-right' ).on( 'click', function ( e ) {
menu.on( 'click', '.menus-move-right', function ( e ) {
api.moveMenuItem( $( this ).parents( 'li.menu-item' ).find( 'a.item-edit' ), 'right' );
e.preventDefault();
});