Browse Source

Issue #423 - right sidebar push not working

- Change body.pushed to always use 'margin-left'
  - Invert margin to negative if its direction is right
pull/424/head
Rich Soni 11 years ago
parent
commit
8fd49d42bb
1 changed files with 4 additions and 1 deletions
  1. 5
      src/modules/sidebar.js

5
src/modules/sidebar.js

@ -202,13 +202,15 @@ $.fn.sidebar = function(parameters) {
add: {
bodyCSS: function(direction, distance) {
var
invertDirection,
style
;
if(direction !== className.bottom) {
invertDirection = direction === 'right' ? -1 : 1;
style = ''
+ '<style title="' + namespace + '">'
+ 'body.pushed {'
+ ' margin-' + direction + ': ' + distance + 'px !important;'
+ ' margin-left: ' + invertDirection * distance + 'px !important;'
+ '}'
+ '</style>'
;
@ -218,6 +220,7 @@ $.fn.sidebar = function(parameters) {
}
},
remove: {
bodyCSS: function() {
module.debug('Removing body css styles', $style);

Loading…
Cancel
Save