mirror of
https://bitbucket.org/skobkin/chrome_point_plus.git
synced 2024-11-13 22:33:05 +00:00
Merge branch 'master' into feature_ajax_comments
This commit is contained in:
commit
e30b440956
|
@ -154,13 +154,31 @@ div#markItUpText-input {
|
|||
|
||||
}
|
||||
|
||||
/* Шваброточки */
|
||||
#comments .post .nesting {
|
||||
height: 24px;
|
||||
float: left;
|
||||
/** Индикация вложенности */
|
||||
|
||||
#comments.nesting_level {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#comments .post:hover .nesting {
|
||||
background-repeat: repeat-x;
|
||||
#comments.nesting_level .info::before {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 100%;
|
||||
|
||||
display: block;
|
||||
|
||||
width: 500px;
|
||||
height: 24px;
|
||||
|
||||
content: '';
|
||||
|
||||
opacity: 0;
|
||||
background-image: url('chrome-extension://__MSG_@@extension_id__/images/nesting-point.png');
|
||||
}
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
|
||||
#comments.nesting_level .post:hover .info::before {
|
||||
transition: opacity .2s ease-in;
|
||||
|
||||
opacity: 1;
|
||||
}
|
||||
|
|
|
@ -651,7 +651,7 @@ $(document).ready(function() {
|
|||
|
||||
// Nesting level indicator
|
||||
if (options.is('option_other_comments_nesting_level')) {
|
||||
draw_nesting_level_indicator();
|
||||
$('#comments').addClass('nesting_level');
|
||||
}
|
||||
|
||||
// Обновляем кол-во постов и непрочитанных комментариев
|
||||
|
@ -1412,36 +1412,6 @@ function hints_save_new_hint(username, new_hint) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Nesting level indicator
|
||||
* Шваброшвабровские точки
|
||||
*/
|
||||
function draw_nesting_level_indicator() {
|
||||
$('.comments').css({'margin-left': '0px'});
|
||||
draw_nesting_level_indicator_level($('#comments > .comments'), 1);
|
||||
}
|
||||
|
||||
function draw_nesting_level_indicator_level(obj, level) {
|
||||
obj.find('> .post').each(function() {
|
||||
var nesting = document.createElement('div');
|
||||
$(nesting).addClass('nesting').css({
|
||||
'width': (10 * level) + 'px'
|
||||
});
|
||||
this.insertBefore(nesting, $(this).find('.info')[0]);
|
||||
|
||||
$(this).find('> .post-content').css({
|
||||
'padding-left': (10 * level) + 'px'
|
||||
});
|
||||
});
|
||||
|
||||
obj.each(function() {
|
||||
var comments = $(this).find('> .comments');
|
||||
if (comments.length > 0) {
|
||||
draw_nesting_level_indicator_level(comments, level + 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Обновляем кол-во комментариев и непрочитанных новых постов в ленте
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue