Browse Source

Adds sidebar widths, shadow by default

pull/1243/head
jlukic 10 years ago
parent
commit
5b664c7114
5 changed files with 80 additions and 27 deletions
  1. 2
      src/definitions/collections/menu.less
  2. 13
      src/definitions/modules/sidebar.js
  3. 62
      src/definitions/modules/sidebar.less
  4. 2
      src/themes/default/collections/menu.variables
  5. 28
      src/themes/default/modules/sidebar.variables

2
src/definitions/collections/menu.less

@ -1367,7 +1367,7 @@
.ui.borderless.menu .item:before, .ui.borderless.menu .item:before,
.ui.borderless.menu .item .menu .item:before, .ui.borderless.menu .item .menu .item:before,
.ui.menu .borderless.item:before { .ui.menu .borderless.item:before {
background: none;
background: none !important;
} }
/*------------------- /*-------------------

13
src/definitions/modules/sidebar.js

@ -75,7 +75,8 @@ $.fn.sidebar = function(parameters) {
transitionEvent = module.get.transitionEvent(); transitionEvent = module.get.transitionEvent();
// cache on initialize // cache on initialize
if( module.is.legacy() ) {
if( module.is.legacy() || settings.legacy) {
settings.transition = 'overlay';
settings.useLegacy = true; settings.useLegacy = true;
} }
@ -193,7 +194,7 @@ $.fn.sidebar = function(parameters) {
+ ' }' + ' }'
+ '</style>' + '</style>'
; ;
$context.append(style);
$head.append(style);
$style = $('style[title=' + namespace + ']'); $style = $('style[title=' + namespace + ']');
module.debug('Adding sizing css to head', $style); module.debug('Adding sizing css to head', $style);
} }
@ -423,7 +424,7 @@ $.fn.sidebar = function(parameters) {
module.remove.animating(); module.remove.animating();
module.remove.transition(); module.remove.transition();
module.remove.bodyCSS(); module.remove.bodyCSS();
if(transition == 'scale down' || (settings.returnScroll && transition !== 'overlay' && module.is.mobile()) ) {
if(transition == 'scale down' || (settings.returnScroll && module.is.mobile()) ) {
module.scrollBack(); module.scrollBack();
} }
$.proxy(callback, element)(); $.proxy(callback, element)();
@ -453,6 +454,7 @@ $.fn.sidebar = function(parameters) {
$pusher.addClass(className.dimmed); $pusher.addClass(className.dimmed);
} }
$context $context
.css('position', 'relative')
.animate(properties, settings.duration, settings.easing, function() { .animate(properties, settings.duration, settings.easing, function() {
module.remove.animating(); module.remove.animating();
module.bind.clickaway(); module.bind.clickaway();
@ -480,6 +482,7 @@ $.fn.sidebar = function(parameters) {
$pusher.removeClass(className.dimmed); $pusher.removeClass(className.dimmed);
} }
$context $context
.css('position', 'relative')
.animate(properties, settings.duration, settings.easing, function() { .animate(properties, settings.duration, settings.easing, function() {
module.remove.animating(); module.remove.animating();
$.proxy(callback, module)(); $.proxy(callback, module)();
@ -489,6 +492,7 @@ $.fn.sidebar = function(parameters) {
scrollToTop: function() { scrollToTop: function() {
module.verbose('Scrolling to top of page to avoid animation issues'); module.verbose('Scrolling to top of page to avoid animation issues');
currentScroll = $(window).scrollTop();
$module.scrollTop(0); $module.scrollTop(0);
window.scrollTo(0, 0); window.scrollTo(0, 0);
}, },
@ -875,11 +879,10 @@ $.fn.sidebar.settings = {
context : 'body', context : 'body',
exclusive : false, exclusive : false,
closable : true, closable : true,
dimPage : true, dimPage : true,
scrollLock : false, scrollLock : false,
returnScroll : true,
returnScroll : false,
useLegacy : false, useLegacy : false,
duration : 500, duration : 500,

62
src/definitions/modules/sidebar.less

@ -43,6 +43,9 @@
overflow-y: auto !important; overflow-y: auto !important;
z-index: @topLayer; z-index: @topLayer;
} }
/* 3D Rendering Fix */
.ui.sidebar * { .ui.sidebar * {
backface-visibility: hidden; backface-visibility: hidden;
transform: rotateZ(0deg); transform: rotateZ(0deg);
@ -52,6 +55,18 @@
Direction Direction
---------------*/ ---------------*/
.ui.left.sidebar {
right: auto;
left: 0px;
transform: translate3d(-100%, 0, 0);
}
.ui.right.sidebar {
right: 0px !important;
left: auto !important;
transform: translate3d(100%, 0%, 0);
}
.ui.top.sidebar, .ui.top.sidebar,
.ui.bottom.sidebar { .ui.bottom.sidebar {
width: 100% !important; width: 100% !important;
@ -59,24 +74,12 @@
overflow-y: visible !important; overflow-y: visible !important;
} }
.ui.left.sidebar {
right: auto;
left: 0px;
transform: translate3d(-100%, 0, 0);
}
.ui.top.sidebar { .ui.top.sidebar {
top: 0px !important; top: 0px !important;
bottom: auto !important; bottom: auto !important;
transform: translate3d(0, -100%, 0); transform: translate3d(0, -100%, 0);
} }
.ui.right.sidebar {
right: 0px !important;
left: auto !important;
transform: translate3d(100%, 0%, 0);
}
.ui.bottom.sidebar { .ui.bottom.sidebar {
top: auto !important; top: auto !important;
bottom: 0px !important; bottom: 0px !important;
@ -179,6 +182,15 @@
visibility: visible; visibility: visible;
} }
.ui.left.visible.sidebar,
.ui.right.visible.sidebar {
box-shadow: @horizontalBoxShadow;
}
.ui.top.visible.sidebar,
.ui.bottom.visible.sidebar {
box-shadow: @verticalBoxShadow;
}
/*-------------- /*--------------
Mobile Mobile
@ -196,11 +208,31 @@
Variations Variations
*******************************/ *******************************/
.ui.sidebar,
.ui.vertical.sidebar.menu {
/*--------------
Width
---------------*/
/* Left / Right */
.ui[class*="very thin"].left.sidebar,
.ui[class*="very thin"].right.sidebar {
width: @sidebarVeryThinWidth;
}
.ui.thin.left.sidebar,
.ui.thin.right.sidebar {
width: @sidebarThinWidth;
}
.ui.left.sidebar,
.ui.right.sidebar {
width: @sidebarWidth; width: @sidebarWidth;
} }
.ui.wide.left.sidebar,
.ui.wide.right.sidebar {
width: @sidebarWideWidth;
}
.ui[class*="very wide"].left.sidebar,
.ui[class*="very wide"].right.sidebar {
width: @sidebarVeryWideWidth;
}
/******************************* /*******************************
Animations Animations

2
src/themes/default/collections/menu.variables

@ -252,7 +252,7 @@
/* Labeled Icon */ /* Labeled Icon */
@labeledIconSize: 1.5em; @labeledIconSize: 1.5em;
@labeledIconMinWidth: 6em; @labeledIconMinWidth: 6em;
@labeledIconTextMargin: 0.3em;
@labeledIconTextMargin: 0.5em;
/* Text */ /* Text */
@textMenuTransition: opacity 0.2s ease; @textMenuTransition: opacity 0.2s ease;

28
src/themes/default/modules/sidebar.variables

@ -2,20 +2,38 @@
Sidebar Sidebar
*******************************/ *******************************/
@sidebarWidth: 260px;
@sidebarHeight: 50px;
/*-------------------
Element
--------------------*/
@dimmerColor: rgba(0, 0, 0, 0.4); @dimmerColor: rgba(0, 0, 0, 0.4);
@canvasBackground: @lightBlack; @canvasBackground: @lightBlack;
@perspective: 1500px; @perspective: 1500px;
@duration: 500ms; @duration: 500ms;
@easing: ease; @easing: ease;
@boxShadow: 0px 0px 20px @borderColor;
@horizontalBoxShadow: @boxShadow;
@verticalBoxShadow: @boxShadow;
/* Indexes */
@bottomLayer: 1; @bottomLayer: 1;
@middleLayer: 2; @middleLayer: 2;
@fixedLayer: 101; @fixedLayer: 101;
@topLayer: 102; @topLayer: 102;
@dimmerLayer: 1000; @dimmerLayer: 1000;
/*-------------------
Variations
--------------------*/
/* Width */
@sidebarVeryThinWidth: 60px;
@sidebarThinWidth: 150px;
@sidebarWidth: 260px;
@sidebarWideWidth: 350px;
@sidebarVeryWideWidth: 475px;
/* Height */
@sidebarHeight: auto;
Loading…
Cancel
Save