Skip to content
Extraits de code Groupes Projets
Valider 5afe5f66 rédigé par Raphael Sofaer's avatar Raphael Sofaer
Parcourir les fichiers

Move js out of notifications index, fix reference to notifications badge

parent a0f98d88
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
:javascript
$('.stream_element').live('mousedown', function(evt){
var note = $(this).closest('.stream_element'),
note_id = note.attr('data-guid'),
nBadge = $("#notification_badge_number");
if(note.hasClass('unread') ){
note.removeClass('unread');
$.ajax({
url: 'notifications/' + note_id,
type: 'PUT'
});
}
if(nBadge.html() != null) {
nBadge.html().replace(/\d+/, function(num){
num = parseInt(num);
nBadge.html(parseInt(num)-1);
if(num == 1) {
nBadge.addClass("hidden");
}
});
}
});
$('a.more').live('click', function(){
$(this).hide();
$(this).next('span').removeClass('hidden');
});
- content_for :head do
= include_javascripts :notifications
.span-1
= image_tag 'icons/mail_big.png', :height => 30, :width => 30, :style=>"margin-top:3px;"
.span-10
......
......@@ -66,6 +66,8 @@ javascripts:
- public/javascripts/inbox.js
profile:
- public/javascripts/vendor/jquery.autoSuggest.custom.js
notifications:
- public/javascripts/notifications.js
stylesheets:
default:
......
$('.stream_element').live('mousedown', function(evt){
var note = $(this).closest('.stream_element'),
note_id = note.attr('data-guid'),
nBadge = $("#notification_badge .badge_count")
if(note.hasClass('unread') ){
note.removeClass('unread');
$.ajax({
url: 'notifications/' + note_id,
type: 'PUT'
});
}
if(nBadge.html() != null) {
nBadge.html().replace(/\d+/, function(num){
num = parseInt(num);
nBadge.html(parseInt(num)-1);
if(num == 1) {
nBadge.addClass("hidden");
}
});
}
});
$('a.more').live('click', function(){
$(this).hide();
$(this).next('span').removeClass('hidden');
});
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter