mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
- fixed #1369;
This commit is contained in:
+28
-27
@@ -16,38 +16,39 @@ jQuery(document).ready(function ($) {
|
||||
}
|
||||
});
|
||||
|
||||
var template = wp.template( 'um-nav-menus-fields' );
|
||||
if ( $('#tmpl-um-nav-menus-fields').length ) {
|
||||
var template = wp.template( 'um-nav-menus-fields' );
|
||||
|
||||
$( document ).on( 'menu-item-added', function ( e, $menuMarkup ) {
|
||||
var id = $( $menuMarkup ).attr('id').substr(10);
|
||||
$( document ).on( 'menu-item-added', function ( e, $menuMarkup ) {
|
||||
var id = $( $menuMarkup ).attr('id').substr(10);
|
||||
|
||||
var template_content = template({
|
||||
menuItemID: id,
|
||||
restriction_data:{
|
||||
um_nav_public:0,
|
||||
um_nav_roles:[]
|
||||
var template_content = template({
|
||||
menuItemID: id,
|
||||
restriction_data:{
|
||||
um_nav_public:0,
|
||||
um_nav_roles:[]
|
||||
}
|
||||
});
|
||||
|
||||
if ( $( $menuMarkup ).find( 'fieldset.field-move' ).length > 0 ) {
|
||||
$( $menuMarkup ).find( 'fieldset.field-move' ).before( template_content );
|
||||
} else {
|
||||
$( $menuMarkup ).find( '.menu-item-actions' ).before( template_content );
|
||||
}
|
||||
});
|
||||
|
||||
if ( $( $menuMarkup ).find( 'fieldset.field-move' ).length > 0 ) {
|
||||
$( $menuMarkup ).find( 'fieldset.field-move' ).before( template_content );
|
||||
} else {
|
||||
$( $menuMarkup ).find( '.menu-item-actions' ).before( template_content );
|
||||
}
|
||||
});
|
||||
$( 'ul#menu-to-edit > li' ).each( function(){
|
||||
var id = $(this).attr('id').substr(10);
|
||||
var template_content = template({
|
||||
menuItemID: id,
|
||||
restriction_data: um_menu_restriction_data[ id ]
|
||||
});
|
||||
|
||||
|
||||
$( 'ul#menu-to-edit > li' ).each( function(){
|
||||
var id = $(this).attr('id').substr(10);
|
||||
var template_content = template({
|
||||
menuItemID: id,
|
||||
restriction_data: um_menu_restriction_data[ id ]
|
||||
if ( $( this ).find( 'fieldset.field-move' ).length > 0 ) {
|
||||
$( this ).find( 'fieldset.field-move' ).before( template_content );
|
||||
} else {
|
||||
$( this ).find( '.menu-item-actions' ).before( template_content );
|
||||
}
|
||||
});
|
||||
|
||||
if ( $( this ).find( 'fieldset.field-move' ).length > 0 ) {
|
||||
$( this ).find( 'fieldset.field-move' ).before( template_content );
|
||||
} else {
|
||||
$( this ).find( '.menu-item-actions' ).before( template_content );
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
jQuery(document).ready(function(i){jQuery(".um-nav-mode").each(function(){2==jQuery(this).find("select").val()?jQuery(this).parents(".um-nav-edit").find(".um-nav-roles").show():jQuery(this).parents(".um-nav-edit").find(".um-nav-roles").hide()}),jQuery(document.body).on("change",".um-nav-mode select",function(){2==jQuery(this).val()?jQuery(this).parents(".um-nav-edit").find(".um-nav-roles").show():jQuery(this).parents(".um-nav-edit").find(".um-nav-roles").hide()});var u=wp.template("um-nav-menus-fields");i(document).on("menu-item-added",function(e,t){var n=i(t).attr("id").substr(10),n=u({menuItemID:n,restriction_data:{um_nav_public:0,um_nav_roles:[]}});(0<i(t).find("fieldset.field-move").length?i(t).find("fieldset.field-move"):i(t).find(".menu-item-actions")).before(n)}),i("ul#menu-to-edit > li").each(function(){var e=i(this).attr("id").substr(10),e=u({menuItemID:e,restriction_data:um_menu_restriction_data[e]});(0<i(this).find("fieldset.field-move").length?i(this).find("fieldset.field-move"):i(this).find(".menu-item-actions")).before(e)})});
|
||||
jQuery(document).ready(function(i){var u;jQuery(".um-nav-mode").each(function(){2==jQuery(this).find("select").val()?jQuery(this).parents(".um-nav-edit").find(".um-nav-roles").show():jQuery(this).parents(".um-nav-edit").find(".um-nav-roles").hide()}),jQuery(document.body).on("change",".um-nav-mode select",function(){2==jQuery(this).val()?jQuery(this).parents(".um-nav-edit").find(".um-nav-roles").show():jQuery(this).parents(".um-nav-edit").find(".um-nav-roles").hide()}),i("#tmpl-um-nav-menus-fields").length&&(u=wp.template("um-nav-menus-fields"),i(document).on("menu-item-added",function(e,n){var t=i(n).attr("id").substr(10),t=u({menuItemID:t,restriction_data:{um_nav_public:0,um_nav_roles:[]}});(0<i(n).find("fieldset.field-move").length?i(n).find("fieldset.field-move"):i(n).find(".menu-item-actions")).before(t)}),i("ul#menu-to-edit > li").each(function(){var e=i(this).attr("id").substr(10),e=u({menuItemID:e,restriction_data:um_menu_restriction_data[e]});(0<i(this).find("fieldset.field-move").length?i(this).find("fieldset.field-move"):i(this).find(".menu-item-actions")).before(e)}))});
|
||||
@@ -58,6 +58,7 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
add_action( 'admin_enqueue_scripts', array( &$this, 'admin_enqueue_scripts' ) );
|
||||
|
||||
add_action( 'load-customize.php', array( &$this, 'navmenu_scripts' ) );
|
||||
add_action( 'load-nav-menus.php', array( &$this, 'navmenu_scripts' ) );
|
||||
add_action( 'load-edit.php', array( &$this, 'posts_page' ) );
|
||||
|
||||
add_action( 'load-post-new.php', array( &$this, 'enqueue_cpt_scripts' ) );
|
||||
|
||||
Reference in New Issue
Block a user