From 46c430a3d894fb506a419e5de40fa3efdcf44cf7 Mon Sep 17 00:00:00 2001 From: isqua Date: Mon, 19 Jan 2015 23:01:02 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D1=8F=D1=82=D1=8C=20=D0=BB=D0=B8=D1=88=D0=BD=D0=B8=D0=B9?= =?UTF-8?q?=20=D1=8D=D0=BB=D0=B5=D0=BC=D0=B5=D0=BD=D1=82=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=BE=D1=82=D1=80=D0=B8=D1=81=D0=BE=D0=B2=D0=BA=D0=B8?= =?UTF-8?q?=20=D1=82=D0=BE=D1=87=D0=B5=D1=87=D0=B5=D0=BA=20=D0=B8=20=D0=BD?= =?UTF-8?q?=D0=B5=20=D0=BF=D0=BE=D1=80=D1=82=D0=B8=D1=82=D1=8C=20=D0=BC?= =?UTF-8?q?=D0=B0=D1=80=D0=B4=D0=B6=D0=B8=D0=BD=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chrome_point_plus/css/point-plus.css | 32 ++++++++++++++++++++++------ chrome_point_plus/js/point-plus.js | 32 +--------------------------- 2 files changed, 26 insertions(+), 38 deletions(-) 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); - } - }); -} - /** * Обновляем кол-во комментариев и непрочитанных новых постов в ленте */