minor refactoring of card-contents-base mixin

minor refactoring of card-contents-base mixin

diff --git a/app/assets/javascripts/discourse/mixins/card-contents-base.js.es6 b/app/assets/javascripts/discourse/mixins/card-contents-base.js.es6
index 1e9160d..931d235 100644
--- a/app/assets/javascripts/discourse/mixins/card-contents-base.js.es6
+++ b/app/assets/javascripts/discourse/mixins/card-contents-base.js.es6
@@ -124,8 +124,7 @@ export default Ember.Mixin.create({
     });
 
     this.appEvents.on(`topic-header:trigger-${id}`, (username, $target) => {
-      this.set("isFixed", true);
-      this.set("isDocked", true);
+      this.setProperties({ isFixed: true, isDocked: true });
       return this._show(username, $target);
     });
   },
@@ -188,8 +187,9 @@ export default Ember.Mixin.create({
             }
           }
 
-          if (isDocked && position.top < 44) {
-            position.top = 44;
+          const avatarOverflowSize = 44;
+          if (isDocked && position.top < avatarOverflowSize) {
+            position.top = avatarOverflowSize;
           }
 
           this.$().css(position);

GitHub sha: 1f12a377

1 Like