diff --git a/chrome_point_plus/css/point-plus.css b/chrome_point_plus/css/point-plus.css index 7f18dc2..5780d35 100644 --- a/chrome_point_plus/css/point-plus.css +++ b/chrome_point_plus/css/point-plus.css @@ -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'); -} \ No newline at end of file + background-repeat: repeat-x; +} + +#comments.nesting_level .post:hover .info::before { + transition: opacity .2s ease-in; + + opacity: 1; +} diff --git a/chrome_point_plus/js/point-plus.js b/chrome_point_plus/js/point-plus.js index d0be6df..085d214 100644 --- a/chrome_point_plus/js/point-plus.js +++ b/chrome_point_plus/js/point-plus.js @@ -625,7 +625,7 @@ $(document).ready(function() { // Nesting level indicator if (options.is('option_other_comments_nesting_level')) { - draw_nesting_level_indicator(); + $('#comments').addClass('nesting_level'); } // Обновляем кол-во постов и непрочитанных комментариев @@ -1312,36 +1312,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); - } - }); -} - /** * Обновляем кол-во комментариев и непрочитанных новых постов в ленте */