- manual merge with RTL branch;

- RTL fixes;
This commit is contained in:
nikitasinelnikov
2019-08-08 00:47:00 +03:00
parent 5f66fd5fe3
commit 1d01e20a13
5 changed files with 133 additions and 54 deletions
+51 -1
View File
@@ -10,6 +10,9 @@
.um-profile-photo a.um-profile-photo-img {
float: right;
left: auto;
}
.um-cover + .um-header .um-profile-photo a.um-profile-photo-img {
right: 30px;
}
@@ -32,7 +35,15 @@ div.uimob800 .um-header .um-profile-meta {
.um-name {
float: right;
margin-right: 0;
margin-left: 30px;
}
.um-profile-nav-item a {
float: right;
padding: 6px 28px 6px 10px;
}
.um-profile-nav-item i {
left: auto;
right: 6px;
}
.um-profile-nav-item a{float: right}
@@ -97,4 +108,43 @@ div.uimob800 .um-header .um-profile-meta {
p.um-notice i {
right: auto;
left: 14px;
}
.um-account.uimob340 .um-account-nav a,
.um-account.uimob500 .um-account-nav a {
padding-left: 0;
padding-right: 40px;
}
.um-account.uimob340 .um-account-nav span.ico,
.um-account.uimob500 .um-account-nav span.ico {
right: 0;
}
.um-account.uimob340 .um-account-nav span.arr,
.um-account.uimob500 .um-account-nav span.arr {
right: auto;
left: 0;
}
.select2.select2-container .select2-selection .select2-selection__arrow {
right: auto !important;
}
.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
padding-right: 8px;
text-align: right;
padding-left: 20px;
}
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
margin-left: 4px;
}
.um-single-image-preview a.cancel, .um-single-file-preview a.cancel {
left: -15px;
right: auto;
}
.cropper-container {
margin: 0 auto;
left: auto !important;
}
+12 -4
View File
@@ -26,10 +26,18 @@ print "
}
";
print "
.um-$form_id.um .um-profile-meta {
padding-left: $meta_padding;
if ( is_rtl() ) {
print "
.um-$form_id.um .um-profile-meta {
padding-right: $meta_padding;
}
";
} else {
print "
.um-$form_id.um .um-profile-meta {
padding-left: $meta_padding;
}
";
}
";
?>
</style>
+54 -45
View File
@@ -21,9 +21,9 @@ function UM_hide_menus() {
menu.hide();
}
function UM_domenus(){
function UM_domenus() {
jQuery('.um-dropdown').each(function(){
jQuery('.um-dropdown').each( function() {
var menu = jQuery(this);
var element = jQuery(this).attr('data-element');
@@ -31,33 +31,41 @@ function UM_domenus(){
jQuery( element ).addClass('um-trigger-menu-on-' + menu.attr( 'data-trigger' ) );
if ( jQuery(window).width() <= 1200 && element == 'div.um-profile-edit' ) {
position = 'lc';
if ( position === 'lc' && jQuery('html').attr('dir') === 'rtl' ){
position = 'rc';
}
if ( jQuery(window).width() <= 1200 && element === 'div.um-profile-edit' ) {
if ( jQuery('html').attr('dir') === 'rtl' ){
position = 'rc';
} else {
position = 'lc';
}
}
if ( position == 'lc' ){
if ( 200 > jQuery(element).find('img').width() ) {
left_p = ( ( jQuery(element).width() - jQuery(element).find('img').width() ) / 2 ) + ( ( jQuery(element).find('img').width() - 200 ) / 2 );
} else {
left_p = ( ( jQuery(element).width() - jQuery(element).find('img').width() ) / 2 );
}
if ( 200 > jQuery(element).find('img').width() ) {
left_p = ( ( jQuery(element).width() - jQuery(element).find('img').width() ) / 2 ) + ( ( jQuery(element).find('img').width() - 200 ) / 2 );
} else {
left_p = ( ( jQuery(element).width() - jQuery(element).find('img').width() ) / 2 );
}
top_ = parseInt( jQuery(element).find('a').css('top') );
top_ = parseInt( jQuery(element).find('a').css('top') );
if ( top_ ) {
top_p = jQuery(element).find('img').height() + 4 + top_;
left_gap = 4;
} else {
top_p = jQuery(element).find('img').height() + 4;
left_gap = 0;
}
if ( top_ ) {
top_p = jQuery(element).find('img').height() + 4 + top_;
left_gap = 4;
} else {
top_p = jQuery(element).find('img').height() + 4;
left_gap = 0;
}
if ( top_p == 4 && element === 'div.um-cover' ) {
top_p = jQuery(element).height() / 2 + ( menu.height() / 2 );
} else if ( top_p == 4 ) {
top_p = jQuery(element).height() + 20;
}
if ( top_p == 4 && element == 'div.um-cover' ) {
top_p = jQuery(element).height() / 2 + ( menu.height() / 2 );
} else if ( top_p == 4 ) {
top_p = jQuery(element).height() + 20;
}
if ( position === 'lc' ) {
gap_right = jQuery(element).width() + 17;
menu.css({
@@ -76,36 +84,37 @@ function UM_domenus(){
'right' : '-17px'
});
}
} else if ( position === 'rc' ) {
if ( position == 'bc' ){
gap_right = jQuery(element).width() + 25;
menu.css({
'top' : 0,
'width': 200,
'left': gap_right + 'px',
'right' : 'auto',
'text-align' : 'center'
});
if ( 200 > jQuery(element).find('img').width() ) {
left_p = ( ( jQuery(element).width() - jQuery(element).find('img').width() ) / 2 ) + ( ( jQuery(element).find('img').width() - 200 ) / 2 );
menu.find('.um-dropdown-arr').find('i').removeClass().addClass('um-icon-arrow-left-b');
menu.find('.um-dropdown-arr').css({
'top' : '4px',
'left' : '-17px',
'right' : 'auto'
});
} else if ( position === 'bc' ) {
if ( jQuery('html').attr('dir') === 'rtl' ){
rtl_gap = 10;
} else {
left_p = ( ( jQuery(element).width() - jQuery(element).find('img').width() ) / 2 );
}
top_ = parseInt( jQuery(element).find('a').css('top') );
if ( top_ ) {
top_p = jQuery(element).find('img').height() + 4 + top_;
left_gap = 4;
} else {
top_p = jQuery(element).find('img').height() + 4;
left_gap = 0;
}
if ( top_p == 4 && element == 'div.um-cover' ) {
top_p = jQuery(element).height() / 2 + ( menu.height() / 2 );
} else if ( top_p == 4 ) {
top_p = jQuery(element).height() + 20;
rtl_gap = 0
}
menu.css({
'top' : top_p,
'width': 200,
'left': left_p + left_gap,
'left': left_p + left_gap + rtl_gap,
'right' : 'auto',
'text-align' : 'center'
});
@@ -56,4 +56,16 @@
.select2-container .select2-choice > .select2-chosen {
margin-right: 10px !important;
margin-left: 26px !important;
}
.um-form-fields-section {
padding: 0 0 0 10px;
}
.um-form-fields-section {
float: right;
}
.um-form-fields-section label input {
float: right;
}
+4 -4
View File
@@ -863,12 +863,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
array(
'id' => 'profile_header_menu',
'type' => 'select',
'label' => __( 'Profile Header Menu Position','ultimate-member' ),
'label' => __( 'Profile Header Menu Position', 'ultimate-member' ),
'default' => um_get_metadefault('profile_header_menu'),
'tooltip' => __('For incompatible themes, please make the menu open from left instead of bottom by default.','ultimate-member'),
'tooltip' => __( 'For incompatible themes, please make the menu open from left instead of bottom by default.','ultimate-member'),
'options' => array(
'bc' => 'Bottom of Icon',
'lc' => 'Left of Icon',
'bc' => __( 'Bottom of Icon', 'ultimate-member' ),
'lc' => __( 'Left of Icon (right for RTL)', 'ultimate-member' ),
),
'size' => 'small'
),