Skip to content

Commit

Permalink
Issue Semantic-Org#423 - right sidebar push not working
Browse files Browse the repository at this point in the history
  - Change body.pushed to always use 'margin-left'
  - Invert margin to negative if its direction is right
  • Loading branch information
Rich Soni authored and MohammadYounes committed Dec 22, 2013
1 parent f6df72c commit 7523601
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/modules/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>'
;
Expand All @@ -218,6 +220,7 @@ $.fn.sidebar = function(parameters) {
}
},


remove: {
bodyCSS: function() {
module.debug('Removing body css styles', $style);
Expand Down

0 comments on commit 7523601

Please sign in to comment.