Browse Source

simplified navbar affix

Rafał Pitoń 10 years ago
parent
commit
d251536ccb
1 changed files with 4 additions and 9 deletions
  1. 4 9
      misago/emberapp/app/components/forum-navbar.js

+ 4 - 9
misago/emberapp/app/components/forum-navbar.js

@@ -4,20 +4,15 @@ export default Ember.Component.extend({
   classNames: 'navbar-spacer',
   classNames: 'navbar-spacer',
 
 
   affixNavbar: function() {
   affixNavbar: function() {
-    // take navbar's height in document
+    // reserve navbar's height in document
     this.$().height(this.$().height());
     this.$().height(this.$().height());
 
 
     // affix navbar
     // affix navbar
-    var offset = this.$('.navbar').offset().top;
-    if (offset === 0) {
-      // workaround around bootstrap affix mishandling elements
-      // with resting position on top of page
-      offset = 1;
-    }
-
     this.$('.navbar').affix({
     this.$('.navbar').affix({
       offset: {
       offset: {
-        top: offset
+        // workaround around bootstrap affix mishandling
+        // elements with resting position on top of page
+        top: this.$('.navbar').offset().top + 1
       }
       }
     });
     });
   }.on('didInsertElement')
   }.on('didInsertElement')