mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- changed form builder > icon field to new dropdown type;
This commit is contained in:
@@ -97,7 +97,14 @@ UM.admin = {
|
||||
select2_atts.dropdownParent = $iconSelector.parents('._heading_text');
|
||||
}
|
||||
|
||||
$iconSelector.select2( select2_atts );
|
||||
$iconSelector.select2( select2_atts ).on( 'change', function () {
|
||||
// handle outdated icons and remove them after select new one.
|
||||
let oldWrapper = $iconSelector.siblings('.um_admin_fonticon_wrapper');
|
||||
if ( oldWrapper.length > 0 ) {
|
||||
oldWrapper.find('#_icon').val( $iconSelector.val() );
|
||||
oldWrapper.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
"object"!=typeof window.UM&&(window.UM={}),"object"!=typeof window.UM.admin&&(window.UM.admin={}),UM.admin={tooltip:{all:null,init:function(){var t=jQuery(".um_tooltip");0<t.length&&(UM.admin.tooltip.all=t.tooltip({tooltipClass:"um_tooltip",content:function(){return jQuery(this).attr("title")}}))},close:function(){null!==UM.admin.tooltip.all&&0<UM.admin.tooltip.all&&"function"==typeof UM.admin.tooltip.all.tooltip&&UM.admin.tooltip.all.tooltip("close")}},colorPicker:{init:function(){var t=jQuery(".um-admin-colorpicker");t.length&&t.wpColorPicker()}},iconSelector:{init:function(){var t,n=jQuery(".um-icon-select-field");function e(t){var n=t.element;return void 0!==n?jQuery('<span><i class="'+jQuery(n).val()+'"></i> '+t.text+"</span>"):jQuery('<span><i class="'+t.id+'"></i> '+t.text+"</span>")}n.length&&(t={ajax:{url:wp.ajax.settings.url,dataType:"json",delay:250,data:function(t){return{search:t.term,action:"um_get_icons",page:t.page||1,nonce:um_admin_scripts.nonce}},processResults:function(t,n){n.page=n.page||1;var e=[];return t.data.icons&&jQuery.each(t.data.icons,function(t,n){e.push({id:t,text:n.label})}),{results:e,pagination:{more:50*n.page<t.data.total_count}}},cache:!0},minimumInputLength:0,allowClear:!0,width:"100%",allowHtml:!0,templateSelection:e,templateResult:e,dropdownCssClass:"um-select2-icon-dropdown",containerCssClass:"um-select2-icon-container"},n.parents(".um-admin-tri").length?t.dropdownParent=n.parents(".um-admin-tri"):n.parents("._heading_text").length&&(t.dropdownParent=n.parents("._heading_text")),n.select2(t))}}},jQuery(document).ready(function(){UM.admin.tooltip.init(),UM.admin.colorPicker.init(),UM.admin.iconSelector.init()});
|
||||
"object"!=typeof window.UM&&(window.UM={}),"object"!=typeof window.UM.admin&&(window.UM.admin={}),UM.admin={tooltip:{all:null,init:function(){var t=jQuery(".um_tooltip");0<t.length&&(UM.admin.tooltip.all=t.tooltip({tooltipClass:"um_tooltip",content:function(){return jQuery(this).attr("title")}}))},close:function(){null!==UM.admin.tooltip.all&&0<UM.admin.tooltip.all&&"function"==typeof UM.admin.tooltip.all.tooltip&&UM.admin.tooltip.all.tooltip("close")}},colorPicker:{init:function(){var t=jQuery(".um-admin-colorpicker");t.length&&t.wpColorPicker()}},iconSelector:{init:function(){let n=jQuery(".um-icon-select-field");function t(t){var n=t.element;return void 0!==n?jQuery('<span><i class="'+jQuery(n).val()+'"></i> '+t.text+"</span>"):jQuery('<span><i class="'+t.id+'"></i> '+t.text+"</span>")}var i;n.length&&(i={ajax:{url:wp.ajax.settings.url,dataType:"json",delay:250,data:function(t){return{search:t.term,action:"um_get_icons",page:t.page||1,nonce:um_admin_scripts.nonce}},processResults:function(t,n){n.page=n.page||1;var i=[];return t.data.icons&&jQuery.each(t.data.icons,function(t,n){i.push({id:t,text:n.label})}),{results:i,pagination:{more:50*n.page<t.data.total_count}}},cache:!0},minimumInputLength:0,allowClear:!0,width:"100%",allowHtml:!0,templateSelection:t,templateResult:t,dropdownCssClass:"um-select2-icon-dropdown",containerCssClass:"um-select2-icon-container"},n.parents(".um-admin-tri").length?i.dropdownParent=n.parents(".um-admin-tri"):n.parents("._heading_text").length&&(i.dropdownParent=n.parents("._heading_text")),n.select2(i).on("change",function(){var t=n.siblings(".um_admin_fonticon_wrapper");0<t.length&&(t.find("#_icon").val(n.val()),t.hide())}))}}},jQuery(document).ready(function(){UM.admin.tooltip.init(),UM.admin.colorPicker.init(),UM.admin.iconSelector.init()});
|
||||
@@ -186,16 +186,30 @@ jQuery(document).ready(function() {
|
||||
/**
|
||||
restore font icon
|
||||
**/
|
||||
// jQuery(document.body).on('click', 'span.um-admin-icon-clear', function(){
|
||||
// var element = jQuery(this).parents('p');
|
||||
// jQuery('#UM_fonticons a.um-admin-modal-back').attr('data-code', '');
|
||||
// element.find('input[type="hidden"]').val('');
|
||||
// element.find('.um-admin-icon-value').html( wp.i18n.__( 'No Icon', 'ultimate-member' ) );
|
||||
//
|
||||
// element = jQuery(this).parents('td');
|
||||
// element.find('input[type="hidden"]').val('');
|
||||
// element.find('.um-admin-icon-value').html( wp.i18n.__( 'No Icon', 'ultimate-member' ) );
|
||||
// jQuery(this).removeClass('show');
|
||||
// });
|
||||
|
||||
jQuery(document.body).on('click', 'span.um-admin-icon-clear', function(){
|
||||
var element = jQuery(this).parents('p');
|
||||
jQuery('#UM_fonticons a.um-admin-modal-back').attr('data-code', '');
|
||||
element.find('input[type="hidden"]').val('');
|
||||
element.find('.um-admin-icon-value').html( wp.i18n.__( 'No Icon', 'ultimate-member' ) );
|
||||
element.find('.um_admin_fonticon_wrapper').hide();
|
||||
// element.find('.um-admin-icon-value').html( wp.i18n.__( 'No Icon', 'ultimate-member' ) );
|
||||
|
||||
element = jQuery(this).parents('td');
|
||||
element.find('input[type="hidden"]').val('');
|
||||
element.find('.um-admin-icon-value').html( wp.i18n.__( 'No Icon', 'ultimate-member' ) );
|
||||
jQuery(this).removeClass('show');
|
||||
element.find('.um_admin_fonticon_wrapper').hide();
|
||||
//element.find('.um-admin-icon-value').html( wp.i18n.__( 'No Icon', 'ultimate-member' ) );
|
||||
//jQuery(this).removeClass('show');
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user