- fixed scroll via enqueue new scroll library;

- fixed order by Display name option
This commit is contained in:
nikitasinelnikov
2019-05-02 18:29:00 +03:00
parent 2e0c712e13
commit 887d4b5293
14 changed files with 4716 additions and 3990 deletions
+190
View File
@@ -0,0 +1,190 @@
[data-simplebar] {
position: relative;
flex-direction: column;
flex-wrap: wrap;
justify-content: flex-start;
align-content: flex-start;
align-items: flex-start;
}
.simplebar-wrapper {
overflow: hidden;
width: inherit;
height: inherit;
max-width: inherit;
max-height: inherit;
}
.simplebar-mask {
direction: inherit;
position: absolute;
overflow: hidden;
padding: 0;
margin: 0;
left: 0;
top: 0;
bottom: 0;
right: 0;
width: auto !important;
height: auto !important;
z-index: 0;
}
.simplebar-offset {
direction: inherit !important;
box-sizing: inherit !important;
resize: none !important;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
padding: 0;
margin: 0;
-webkit-overflow-scrolling: touch;
}
.simplebar-content-wrapper {
direction: inherit;
box-sizing: border-box !important;
position: relative;
display: block;
height: 100%; /* Required for horizontal native scrollbar to not appear if parent is taller than natural height */
width: auto;
visibility: visible;
overflow: auto; /* Scroll on this element otherwise element can't have a padding applied properly */
max-width: 100%; /* Not required for horizontal scroll to trigger */
max-height: 100%; /* Needed for vertical scroll to trigger */
}
.simplebar-content:before,
.simplebar-content:after {
content: " ";
display: table;
}
.simplebar-placeholder {
max-height: 100%;
max-width: 100%;
width: 100%;
pointer-events: none;
}
.simplebar-height-auto-observer-wrapper {
box-sizing: inherit !important;
height: 100%;
width: inherit;
max-width: 1px;
position: relative;
float: left;
max-height: 1px;
overflow: hidden;
z-index: -1;
padding: 0;
margin: 0;
pointer-events: none;
flex-grow: inherit;
flex-shrink: 0;
flex-basis: 0;
}
.simplebar-height-auto-observer {
box-sizing: inherit;
display: block;
opacity: 0;
position: absolute;
top: 0;
left: 0;
height: 1000%;
width: 1000%;
min-height: 1px;
min-width: 1px;
overflow: hidden;
pointer-events: none;
z-index: -1;
}
.simplebar-track {
z-index: 1;
position: absolute;
right: 0;
bottom: 0;
pointer-events: none;
overflow: hidden;
}
[data-simplebar].simplebar-dragging .simplebar-track {
pointer-events: all;
}
.simplebar-scrollbar {
position: absolute;
right: 2px;
width: 7px;
min-height: 10px;
}
.simplebar-scrollbar:before {
position: absolute;
content: "";
background: black;
border-radius: 7px;
left: 0;
right: 0;
opacity: 0;
transition: opacity 0.2s linear;
}
.simplebar-track .simplebar-scrollbar.simplebar-visible:before {
/* When hovered, remove all transitions from drag handle */
opacity: 0.5;
transition: opacity 0s linear;
}
.simplebar-track.simplebar-vertical {
top: 0;
width: 11px;
}
.simplebar-track.simplebar-vertical .simplebar-scrollbar:before {
top: 2px;
bottom: 2px;
}
.simplebar-track.simplebar-horizontal {
left: 0;
height: 11px;
}
.simplebar-track.simplebar-horizontal .simplebar-scrollbar:before {
height: 100%;
left: 2px;
right: 2px;
}
.simplebar-track.simplebar-horizontal .simplebar-scrollbar {
right: auto;
left: 0;
top: 2px;
height: 7px;
min-height: 0;
min-width: 10px;
width: auto;
}
/* Rtl support */
[data-simplebar-direction="rtl"] .simplebar-track.simplebar-vertical {
right: auto;
left: 0;
}
.hs-dummy-scrollbar-size {
direction: rtl;
position: fixed;
opacity: 0;
visibility: hidden;
height: 500px;
width: 500px;
overflow-y: hidden;
overflow-x: scroll;
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1
View File
File diff suppressed because one or more lines are too long
+1 -9
View File
@@ -707,12 +707,6 @@ function remove_Modal() {
if ( jQuery('.um-popup-overlay').length ) {
jQuery( document ).trigger( 'um_before_modal_removed' );
if ( jQuery('.um-popup-autogrow:visible').length ) {
jQuery('.um-popup-autogrow:visible').mCustomScrollbar("destroy");
} else if ( jQuery('.um-popup-autogrow2:visible').length ) {
jQuery('.um-popup-autogrow2:visible').mCustomScrollbar("destroy");
}
jQuery('.tipsy').remove();
jQuery('.um-popup').empty().remove();
jQuery('.um-popup-overlay').empty().remove();
@@ -733,7 +727,7 @@ function show_Modal( contents ) {
function responsive_Modal() {
if ( jQuery('.um-popup-overlay').length ) {
ag_height = jQuery(window).height() - jQuery('.um-popup um-popup-header').outerHeight() - jQuery('.um-popup .um-popup-footer').outerHeight() - 80;
ag_height = jQuery(window).height() - jQuery('.um-popup .um-popup-header').outerHeight() - jQuery('.um-popup .um-popup-footer').outerHeight() - 80;
if ( ag_height > 350 ) {
ag_height = 350;
}
@@ -741,12 +735,10 @@ function responsive_Modal() {
if ( jQuery('.um-popup-autogrow:visible').length ) {
jQuery('.um-popup-autogrow:visible').css({'height': ag_height + 'px'});
jQuery('.um-popup-autogrow:visible').mCustomScrollbar({ theme:"dark-3", mouseWheelPixels:500 }).mCustomScrollbar("scrollTo", "bottom",{ scrollInertia:0} );
} else if ( jQuery('.um-popup-autogrow2:visible').length ) {
jQuery('.um-popup-autogrow2:visible').css({'max-height': ag_height + 'px'});
jQuery('.um-popup-autogrow2:visible').mCustomScrollbar({ theme:"dark-3", mouseWheelPixels:500 });
}
}
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
-1
View File
File diff suppressed because one or more lines are too long
+3 -2
View File
@@ -143,6 +143,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
wp_register_style( 'um_datetime_date', $this->front_css_baseurl . 'pickadate/default.date.css', array( 'um_datetime' ), ultimatemember_version );
wp_register_style( 'um_datetime_time', $this->front_css_baseurl . 'pickadate/default.time.css', array( 'um_datetime' ), ultimatemember_version );
wp_register_style( 'um_scrollbar', $this->front_css_baseurl . 'simplebar.css', array(), ultimatemember_version );
wp_register_style( 'um_crop', $this->front_css_baseurl . 'um-crop.css', array(), ultimatemember_version );
wp_register_style( 'um_tipsy', $this->front_css_baseurl . 'um-tipsy.css', array(), ultimatemember_version );
wp_register_style( 'um_responsive', $this->front_css_baseurl . 'um-responsive.css', array(), ultimatemember_version );
@@ -152,7 +153,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
wp_register_style( 'um_profile', $this->front_css_baseurl . 'um-profile.css', array(), ultimatemember_version );
wp_register_style( 'um_account', $this->front_css_baseurl . 'um-account.css', array(), ultimatemember_version );
wp_register_style( 'um_misc', $this->front_css_baseurl . 'um-misc.css', array(), ultimatemember_version );
wp_register_style( 'um_default_css', $this->front_css_baseurl . 'um-old-default.css', array( 'um_crop', 'um_tipsy', 'um_raty', 'um_responsive', 'um_modal', 'um_styles', 'um_members', 'um_profile', 'um_account', 'um_misc', 'um_datetime_date', 'um_datetime_time' ), ultimatemember_version );
wp_register_style( 'um_default_css', $this->front_css_baseurl . 'um-old-default.css', array( 'um_crop', 'um_tipsy', 'um_raty', 'um_responsive', 'um_modal', 'um_styles', 'um_members', 'um_profile', 'um_account', 'um_misc', 'um_datetime_date', 'um_datetime_time', 'um_scrollbar' ), ultimatemember_version );
wp_enqueue_script( 'um_modal' );
wp_enqueue_style( 'um_default_css' );
@@ -349,7 +350,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
* Load functions js
*/
function load_functions() {
wp_register_script( 'um_scrollbar', um_url . 'assets/js/um-scrollbar.js', array( 'jquery' ), ultimatemember_version, true );
wp_register_script( 'um_scrollbar', um_url . 'assets/js/simplebar.js', array( 'jquery' ), ultimatemember_version, true );
wp_register_script( 'um_functions', um_url . 'assets/js/um-functions.js', array( 'jquery', 'jquery-masonry', 'wp-util', 'um_scrollbar' ), ultimatemember_version, true );
wp_enqueue_script( 'um_functions' );
}
+21
View File
@@ -328,5 +328,26 @@ if ( ! class_exists( 'UM_Functions' ) ) {
$cpt = apply_filters( 'um_cpt_list', array( 'um_form', 'um_directory' ) );
return $cpt;
}
/**
* @param array $array
* @param string $key
* @param array $insert_array
*
* @return array
*/
function array_insert_before( $array, $key, $insert_array ) {
$index = array_search( $key, array_keys( $array ) );
if ( $index === false ) {
return $array;
}
$array = array_slice( $array, 0, $index, true ) +
$insert_array +
array_slice( $array, $index, count( $array ) - 1, true );
return $array;
}
}
}
+2 -2
View File
@@ -82,7 +82,7 @@ if ( ! class_exists( 'um\core\Enqueue' ) ) {
}
wp_register_script( 'select2', $this->js_baseurl . 'select2/select2.full.min.js', array( 'jquery', 'jquery-masonry' ), ultimatemember_version, true );
wp_register_script( 'um_scrollbar', $this->js_baseurl . 'um-scrollbar' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true );
wp_register_script( 'um_scrollbar', $this->js_baseurl . 'simplebar' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true );
wp_register_script( 'um_jquery_form', $this->js_baseurl . 'um-jquery-form' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true );
wp_register_script( 'um_fileupload', $this->js_baseurl . 'um-fileupload' . $this->suffix . '.js', array( 'jquery', 'um_jquery_form' ), ultimatemember_version, true );
@@ -158,7 +158,7 @@ if ( ! class_exists( 'um\core\Enqueue' ) ) {
wp_register_style( 'um_datetime', $this->css_baseurl . 'pickadate/default.css', array(), ultimatemember_version );
wp_register_style( 'um_datetime_date', $this->css_baseurl . 'pickadate/default.date.css', array( 'um_datetime' ), ultimatemember_version );
wp_register_style( 'um_datetime_time', $this->css_baseurl . 'pickadate/default.time.css', array( 'um_datetime' ), ultimatemember_version );
wp_register_style( 'um_scrollbar', $this->css_baseurl . 'um-scrollbar.css', array(), ultimatemember_version );
wp_register_style( 'um_scrollbar', $this->css_baseurl . 'simplebar.css', array(), ultimatemember_version );
wp_register_style( 'um_rtl', $this->css_baseurl . 'um.rtl.css', array(), ultimatemember_version );
wp_register_style( 'um_default_css', $this->css_baseurl . 'um-old-default.css', array(), ultimatemember_version );
+5 -4
View File
@@ -25,9 +25,9 @@ if ( ! class_exists( 'um\core\Members' ) ) {
*/
function __construct() {
add_filter('user_search_columns', array(&$this, 'user_search_columns'), 99 );
add_filter( 'user_search_columns', array( &$this, 'user_search_columns' ), 99 );
add_action('template_redirect', array(&$this, 'access_members'), 555);
add_action( 'template_redirect', array( &$this, 'access_members' ), 555);
$this->core_search_fields = array(
'user_login',
@@ -48,7 +48,7 @@ if ( ! class_exists( 'um\core\Members' ) ) {
*
* @return array
*/
function user_search_columns( $search_columns ){
function user_search_columns( $search_columns ) {
if ( is_admin() ) {
$search_columns[] = 'display_name';
}
@@ -198,7 +198,7 @@ if ( ! class_exists( 'um\core\Members' ) ) {
$attrs = apply_filters( 'um_search_fields', $attrs );
if ( $type == 'select' ) {
if( isset($attrs) && is_array( $attrs['options'] ) ){
if ( isset( $attrs ) && is_array( $attrs['options'] ) ) {
asort( $attrs['options'] );
}
/**
@@ -228,6 +228,7 @@ if ( ! class_exists( 'um\core\Members' ) ) {
return compact( 'type', 'attrs' );
}
/**
* Show filter
*
+17 -7
View File
@@ -1,33 +1,39 @@
<?php
namespace um\core;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! class_exists( 'um\core\Multisite' ) ) {
/**
* Class Multisite
*
* @package um\core
*/
class Multisite {
/**
* Multisite constructor.
*/
function __construct() {
add_action( 'wpmu_new_blog', array( &$this, 'create_new_blog_old_wp' ) );
add_action( 'wp_insert_site', array( &$this, 'create_new_blog' ) );
add_action( 'wpmu_new_blog', array( &$this, 'create_new_blog_old_wp' ), 10, 1 );
add_action( 'wp_insert_site', array( &$this, 'create_new_blog' ), 10, 1 );
}
/**
* Make default UM installation at the new blog if UM is active for network
*
* is deprecated in WP 5.1
*
* @param $blog_id
*/
function create_new_blog_old_wp ( $blog_id ) {
function create_new_blog_old_wp( $blog_id ) {
switch_to_blog( $blog_id );
UM()->single_site_activation();
@@ -35,10 +41,14 @@ if ( ! class_exists( 'um\core\Multisite' ) ) {
}
/**
* @param $blog
* Make default UM installation at the new blog if UM is active for network
* works since 5.1 WP version
*
* @param \WP_Site $blog
*/
function create_new_blog ( $blog ) {
function create_new_blog( $blog ) {
switch_to_blog( $blog->blog_id );
UM()->single_site_activation();
+23 -14
View File
@@ -345,9 +345,9 @@ function um_prepare_user_query_args( $query_args, $args ) {
// must have a cover photo
if ( $has_cover_photo == 1 ) {
$query_args['meta_query'][] = array(
'key' => 'cover_photo',
'value' => '',
'compare' => '!='
'key' => 'cover_photo',
'value' => '',
'compare' => '!='
);
}
@@ -362,16 +362,8 @@ function um_prepare_user_query_args( $query_args, $args ) {
// add roles to appear in directory
if ( ! empty( $roles ) ) {
//since WP4.4 use 'role__in' argument
$query_args['role__in'] = $roles;
/*$query_args['meta_query'][] = array(
'key' => 'role',
'value' => $roles,
'compare' => 'IN'
);*/
}
// sort members by
@@ -384,7 +376,24 @@ function um_prepare_user_query_args( $query_args, $args ) {
$query_args['meta_key'] = $sortby_custom;
$query_args['orderby'] = 'meta_value, display_name';
} else if ( in_array( $sortby, array( 'last_name', 'first_name' ) ) ) {
} elseif ( 'display_name' == $sortby ) {
$query_args['meta_query'][] = array(
'relation' => 'OR',
'full_name' => array(
'key' => 'full_name',
'compare' => 'EXISTS'
),
array(
'key' => 'full_name',
'compare' => 'NOT EXISTS'
)
);
$query_args['orderby'] = 'full_name, display_name';
$order = 'ASC';
} elseif ( in_array( $sortby, array( 'last_name', 'first_name' ) ) ) {
$query_args['meta_key'] = $sortby;
$query_args['orderby'] = 'meta_value';
@@ -392,7 +401,7 @@ function um_prepare_user_query_args( $query_args, $args ) {
} else {
if ( strstr( $sortby, '_desc' ) ) {
$sortby = str_replace('_desc','',$sortby);
$sortby = str_replace( '_desc', '', $sortby );
$order = 'DESC';
}
@@ -431,7 +440,7 @@ function um_prepare_user_query_args( $query_args, $args ) {
* }
* ?>
*/
$query_args = apply_filters('um_modify_sortby_parameter', $query_args, $sortby);
$query_args = apply_filters( 'um_modify_sortby_parameter', $query_args, $sortby );
}