Skip to content

Commit

Permalink
Added perfect-scrollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
jaideng123 committed Aug 21, 2014
1 parent 920b91f commit 2ffae3d
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 8 deletions.
7 changes: 6 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
source 'https://rubygems.org'
source 'https://rails-assets.org'

gem 'rails', '3.2.19'

Expand Down Expand Up @@ -119,7 +120,7 @@ group :assets do

# CSS

gem 'bootstrap-sass', '2.2.2.0'
gem 'bootstrap-sass', '2.3.0.0'
gem 'compass-rails', '1.1.7'
gem 'sass-rails', '3.2.6'

Expand All @@ -132,6 +133,10 @@ group :assets do
gem 'backbone-on-rails', '1.1.1'
gem 'handlebars_assets', '0.12.0'
gem 'jquery-rails', '3.0.4'

# jQuery Plugins

gem 'rails-assets-perfect-scrollbar'

# Windows and OSX have an execjs compatible runtime built-in, Linux users should
# install Node.js or use 'therubyracer'.
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ GEM
jquery-rails
railties
bcrypt (3.1.7)
bootstrap-sass (2.2.2.0)
bootstrap-sass (2.3.0.0)
sass (~> 3.2)
builder (3.0.4)
capybara (2.2.1)
Expand Down Expand Up @@ -331,7 +331,7 @@ GEM
actionpack (>= 3.1)
activesupport (>= 3.1)
rails_admin (0.4.9)
bootstrap-sass (~> 2.2)
bootstrap-sass (~> 2.3)
builder (~> 3.0)
coffee-rails (>= 3.1, < 5)
font-awesome-rails (~> 3.0)
Expand Down Expand Up @@ -475,7 +475,7 @@ DEPENDENCIES
addressable (= 2.3.6)
asset_sync (= 1.0.0)
backbone-on-rails (= 1.1.1)
bootstrap-sass (= 2.2.2.0)
bootstrap-sass (= 2.3.0.0)
capybara (= 2.2.1)
carrierwave (= 0.10.0)
compass-rails (= 1.1.7)
Expand Down
2 changes: 2 additions & 0 deletions app/assets/javascripts/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
//= require_tree ./collections
//= require_tree ./views

//= require perfect-scrollbar

var app = {
collections: {},
models: {},
Expand Down
3 changes: 3 additions & 0 deletions app/assets/javascripts/widgets/notifications-badge.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
};

this.hideDropdown = function() {
$('.notifications').perfectScrollbar('destroy');
self.badge.removeClass("active");
self.dropdown.css("display", "none");
};
Expand Down Expand Up @@ -74,6 +75,8 @@
self.dropdownNotifications.find('.read').each(function(index) {
Diaspora.page.header.notifications.setUpRead( $(this) );
});
$('.notifications').perfectScrollbar();
$(".notifications").scrollTop(0);
self.ajaxLoader.hide();
};
};
Expand Down
6 changes: 4 additions & 2 deletions app/assets/javascripts/widgets/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
});
};
this.setUpUnread = function( an_obj ) {
console.log('Set up unread');
an_obj.removeClass("read").addClass( "unread" );
an_obj.find('.unread-toggle')
.unbind("click")
Expand All @@ -66,9 +67,10 @@
.tooltip('destroy')
.removeAttr('data-original-title')
.attr('title', Diaspora.I18n.t('notifications.mark_read'))
.tooltip();
.tooltip({container: '#notification_dropdown'});
}
this.setUpRead = function( an_obj ) {
console.log('Set up read');
an_obj.removeClass("unread").addClass( "read" );
an_obj.find('.unread-toggle')
.unbind("click")
Expand All @@ -77,7 +79,7 @@
.tooltip('destroy')
.removeAttr('data-original-title')
.attr('title', Diaspora.I18n.t('notifications.mark_unread'))
.tooltip();
.tooltip({container: '#notification_dropdown'});
}
this.clickSuccess = function( data ) {
var itemID = data["guid"]
Expand Down
2 changes: 2 additions & 0 deletions app/assets/stylesheets/application.css.sass
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
@import 'new_styles/_forms'
@import 'tag'

@import 'perfect-scrollbar'

/* ====== media ====== */
.media
:margin 10px
Expand Down
5 changes: 3 additions & 2 deletions app/assets/stylesheets/header.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ body > header {
padding: 15px;
}
.notifications{
overflow-y: auto;
overflow-x: hidden;
overflow: hidden;
position: relative;
max-height: 325px;
}

Expand Down Expand Up @@ -184,6 +184,7 @@ body > header {
}

&.unread {

background-color: $background-grey;
color: $black;
.unread-toggle {
Expand Down

0 comments on commit 2ffae3d

Please sign in to comment.