Skip to content

Commit

Permalink
rtl support fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dio-el-claire committed Jul 7, 2011
1 parent 73c8dfe commit 2e7c2c9
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 25 deletions.
23 changes: 17 additions & 6 deletions css/contexmenu.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,37 @@
/* text in item */
.elfinder-contextmenu .elfinder-contextmenu-item span { font-size:.76em; display:block; }



/* submenu item in rtl/ltr enviroment */
.elfinder-contextmenu-ltr .elfinder-contextmenu-sub .elfinder-contextmenu-item { padding-left:12px; }
.elfinder-contextmenu-ltr .elfinder-contextmenu-item { text-align:left; }
.elfinder-contextmenu-rtl .elfinder-contextmenu-item { text-align:right; }
.elfinder-contextmenu-ltr .elfinder-contextmenu-sub .elfinder-contextmenu-item { padding-left:12px; }
.elfinder-contextmenu-rtl .elfinder-contextmenu-sub .elfinder-contextmenu-item { padding-right:12px; }

/* command/submenu icon */
.elfinder-contextmenu-group .ui-icon,
.elfinder-contextmenu-arrow,
.elfinder-contextmenu-icon {
position:absolute;
top:50%;
margin-top:-8px;
}

/* submenu icon in rtl/ltr enviroment */
.elfinder-contextmenu-ltr .elfinder-contextmenu-group .ui-icon { right:5px; }
.elfinder-contextmenu-rtl .elfinder-contextmenu-group .ui-icon { left:5px; }

/* command icon in rtl/ltr enviroment */
.elfinder-contextmenu-ltr .elfinder-contextmenu-icon { left:8px; }
.elfinder-contextmenu-rtl .elfinder-contextmenu-icon { right:8px; }

/* arrow icon */
.elfinder-contextmenu-arrow {
width:16px;
height:16px;
background:url('../img/arrows-normal.png') 5px 4px no-repeat;
}

/* arrow icon in rtl/ltr enviroment */
.elfinder-contextmenu-ltr .elfinder-contextmenu-arrow { right:5px; }
.elfinder-contextmenu-rtl .elfinder-contextmenu-arrow { left:5px; background-position: 0 -10px; }

/* disable ui border/bg image on hover */
.elfinder-contextmenu .ui-state-hover { border:0 solid; background-image:none;}

Expand Down
16 changes: 9 additions & 7 deletions css/navbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,24 @@

/* container */
.elfinder .elfinder-navbar {
width:220px;
padding:3px 10px 3px 1px;
width:230px;
padding:3px 5px;
font-size:.72em;
background-image:none;
border-top:0 solid;
border-bottom:0 solid;
overflow:auto;
display:none;
/* border:1px solid #111;*/
}


/* ltr/rtl enviroment */
.elfinder-ltr .elfinder-navbar { float:left; border-left:0 solid; }
.elfinder-rtl .elfinder-navbar { float:right; border-right:0 solid; }
.elfinder-ltr .elfinder-navbar { float:left; border-left:0 solid; padding-right:10px; }
.elfinder-rtl .elfinder-navbar { float:right; border-right:0 solid; padding-left:10px; }

/* folders tree container */
.elfinder-tree { display:table; width:100%; margin-bottom:.5em; }
.elfinder-tree { display:table; width:100%; margin: 0 0 .5em 0; }

/* one folder wrapper */
.elfinder-navbar-wrapper, .elfinder-place-wrapper { }
Expand Down Expand Up @@ -52,6 +53,7 @@
margin-top:-8px;
background-image:url("../img/arrows-normal.png");
background-repeat:no-repeat;
/* border:1px solid #111;*/
}

.ui-state-active .elfinder-navbar-arrow { background-image:url("../img/arrows-active.png"); }
Expand All @@ -61,7 +63,7 @@

/* arrow ltr/rtl enviroment */
.elfinder-ltr .elfinder-navbar-collapsed .elfinder-navbar-arrow { background-position: 0 4px; left:0; }
.elfinder-rtl .elfinder-navbar-expanded .elfinder-navbar-arrow { right:0; }
.elfinder-rtl .elfinder-navbar-collapsed .elfinder-navbar-arrow { background-position: 0 -10px; right:0; }
.elfinder-ltr .elfinder-navbar-expanded .elfinder-navbar-arrow,
.elfinder-rtl .elfinder-navbar-expanded .elfinder-navbar-arrow { background-position:0 -21px; }

Expand Down Expand Up @@ -123,7 +125,7 @@
.elfinder-rtl .elfinder-navbar .elfinder-symlink { right: 8px; }

/* resizable */
.elfinder-navbar .ui-resizable-handle { width:12px; background:transparent; }
.elfinder-navbar .ui-resizable-handle { width:12px; background:transparent url('../img/resize.png') bottom center no-repeat; }
.elfinder-ltr .elfinder-navbar .ui-resizable-handle { right:0; }
.elfinder-rtl .elfinder-navbar .ui-resizable-handle { left:0; }
.elfinder-nav-handle-icon {
Expand Down
4 changes: 3 additions & 1 deletion css/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@

.std42-dialog .elfinder-help, .std42-dialog .elfinder-help .ui-widget-content { background:#fff;}


/* contextmenu */
.elfinder-contextmenu .ui-state-hover { background: #3875d7; color:#fff; }
.elfinder-contextmenu .ui-state-hover .elfinder-contextmenu-arrow { background-image:url('../img/arrows-active.png'); }



Expand Down
9 changes: 7 additions & 2 deletions css/toolbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@
.elfinder .elfinder-button.ui-state-disabled .elfinder-button-icon { opacity:.4; filter:Alpha(Opacity=40);}

/* rtl enviroment */
.elfinder-rtl .elfinder-buttonset,
.elfinder-rtl .elfinder-button { float:right; }
.elfinder-rtl .elfinder-buttonset { float:right; }

/* icon inside button */
.elfinder-button-icon {
Expand Down Expand Up @@ -113,6 +112,8 @@
/* button with dropdown menu*/
.elfinder .elfinder-menubutton { overflow:visible; }



/* menu */
.elfinder-button-menu {
position:absolute;
Expand All @@ -138,8 +139,10 @@
top:0;
right:0;
opacity: 0; filter:Alpha(Opacity=0);
cursor: pointer;
}

.elfinder .elfinder-button form input { background:transparent; cursor: default;}

/* search "button" */
.elfinder .elfinder-button-search {
Expand Down Expand Up @@ -170,6 +173,8 @@
outline:0 solid;
}

.elfinder-rtl .elfinder-button-search input { direction:rtl;}

/* icons */
.elfinder-button-search .ui-icon {
position:absolute;
Expand Down
Binary file added img/resize.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion js/i18n/elfinder.ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ if (elFinder && elFinder.prototype && typeof(elFinder.prototype.i18) == 'object'
elFinder.prototype.i18.ru = {
translator : 'Vasiliy Razumnih <[email protected]>',
language : 'Русский язык',
direction : 'ltr',
direction : 'rtl',
messages : {
/********************************** errors **********************************/
'error' : 'Ошибка',
Expand Down
2 changes: 1 addition & 1 deletion js/ui/contexmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ $.fn.elfindercontextmenu = function(fm) {
if (cmd.variants) {

sub = $('<div class="ui-corner-all '+clSub+'"/>')
.appendTo(item.addClass(clGroup).append('<span class="ui-icon ui-icon-triangle-1-e"/>'));
.appendTo(item.addClass(clGroup).append('<span class="elfinder-contextmenu-arrow"/>'));

$.each(cmd.variants, function(i, variant) {
sub.append($('<div class="'+clItem+'"><span>'+variant[1]+'</span></div>')
Expand Down
16 changes: 9 additions & 7 deletions js/ui/navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,27 @@ $.fn.elfindernavbar = function(fm) {
parent = nav.parent()
.resize(function() {
nav.height(wz.height() - delta);
icon && icon.length && pos();
}),
wz = parent.children('.elfinder-workzone').append(nav),
delta = nav.outerHeight() - nav.height(),
ltr = fm.direction == 'ltr',
css = ltr ? 'left' : 'right',
pos = function() { icon.css(css, parseInt(handle.offset()[css])-icon.outerWidth()+'px'); },
handle, icon;
handle;


if ($.fn.resizable) {
icon = $('<span class="elfinder-nav-handle-icon ui-icon ui-icon-grip-solid-vertical"/>').prependTo(wz).zIndex(nav.zIndex()+10);
handle = nav.resizable({handles : ltr ? 'e' : 'n'})
.resize(pos)
handle = nav.resizable({handles : ltr ? 'e' : 'w'})
.scroll(function() {
handle.css('top', parseInt(nav.scrollTop())+'px');
})

.find('.ui-resizable-handle');

if (!ltr) {
nav.resize(function() {
nav.css('left', null).css('right', 0);
})
}

fm.one('open', function() {
setTimeout(function() {
parent.trigger('resize');
Expand Down

0 comments on commit 2e7c2c9

Please sign in to comment.