Commit 5516926b authored by Steffen van Bergerem's avatar Steffen van Bergerem Committed by Jonne Haß

Update perfect-scrollbar

closes #6085
parent dd1cea96
# 0.5.2.0
# Refactor
* Update perfect-scrollbar [#6085](https://github.com/diaspora/diaspora/pull/6085)
# 0.5.1.0
## Configuration changes
......
......@@ -108,7 +108,7 @@ source "https://rails-assets.org" do
gem "rails-assets-jquery-idletimer", "1.0.1"
gem "rails-assets-jquery-placeholder", "2.1.1"
gem "rails-assets-jquery-textchange", "0.2.3"
gem "rails-assets-perfect-scrollbar", "0.5.9"
gem "rails-assets-perfect-scrollbar", "0.6.2"
gem "rails-assets-jakobmattsson--jquery-elastic", "1.6.11"
end
......
......@@ -551,8 +551,7 @@ GEM
rails-assets-markdown-it-sanitizer (0.3.1)
rails-assets-markdown-it-sub (1.0.0)
rails-assets-markdown-it-sup (1.0.0)
rails-assets-perfect-scrollbar (0.5.9)
rails-assets-jquery (>= 1.10)
rails-assets-perfect-scrollbar (0.6.2)
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.6)
......@@ -836,7 +835,7 @@ DEPENDENCIES
rails-assets-markdown-it-sanitizer (= 0.3.1)!
rails-assets-markdown-it-sub (= 1.0.0)!
rails-assets-markdown-it-sup (= 1.0.0)!
rails-assets-perfect-scrollbar (= 0.5.9)!
rails-assets-perfect-scrollbar (= 0.6.2)!
rails-i18n (= 4.0.4)
rails-timeago (= 2.11.0)
rails_admin (= 0.6.7)
......
......@@ -14,7 +14,7 @@
//= require_tree ./collections
//= require_tree ./views
//= require perfect-scrollbar
//= require perfect-scrollbar/perfect-scrollbar.jquery
var app = {
collections: {},
......
......@@ -15,6 +15,7 @@ app.views.NotificationDropdown = app.views.Base.extend({
this.dropdown = $('#notification_dropdown');
this.dropdownNotifications = this.dropdown.find('.notifications');
this.ajaxLoader = this.dropdown.find('.ajax_loader');
this.perfectScrollbarInitialized = false;
},
toggleDropdown: function(evt){
......@@ -43,7 +44,10 @@ app.views.NotificationDropdown = app.views.Base.extend({
if(!inDropdown && !inHovercard && this.dropdownShowing()){
this.badge.removeClass('active');
this.dropdown.css('display', 'none');
this.dropdownNotifications.perfectScrollbar('destroy');
if(this.perfectScrollbarInitialized) {
this.dropdownNotifications.perfectScrollbar("destroy");
this.perfectScrollbarInitialized = false;
}
}
},
......@@ -108,8 +112,12 @@ app.views.NotificationDropdown = app.views.Base.extend({
app.helpers.timeago(this.dropdownNotifications);
this.dropdownNotifications.perfectScrollbar('destroy').perfectScrollbar();
this.dropdownNotifications.removeClass('loading');
if(this.perfectScrollbarInitialized) {
this.dropdownNotifications.perfectScrollbar("destroy");
}
this.dropdownNotifications.perfectScrollbar();
this.perfectScrollbarInitialized = true;
this.dropdownNotifications.removeClass("loading");
this.dropdownNotifications.scroll(function(){
self.dropdownScroll();
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment