Commit 1ba6ed0a9a3bc00526beec799ed04df92eca9973
1 parent
b54cf5a0
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Corrigido: Quando clico em qualquer porção do texto, mesmo sem seleção, mostra o…
… balão para comentar, isso é estranho, não indica se estou comentando no paragrafo todo ou apenas naquele ponto do texto, etc... Corrigido: O número de comentários ao lado deve ser um link, ou seja, ao passar o mouse o cursor deve mudar Corrigido: Em que momento irá ser desfeita Seria interessante ser possível desfazer uma seleção de um trecho, quando eu seleciono não consigo desfazer a seleção até que eu faça uma seleção nova
Showing
2 changed files
with
70 additions
and
56 deletions
Show diff stats
plugins/comment_paragraph/public/comment_paragraph_macro.js
| ... | ... | @@ -111,6 +111,7 @@ jQuery(document).ready(function($) { |
| 111 | 111 | $("#comment-bubble").hide(); |
| 112 | 112 | //Undo previous highlight from the paragraph |
| 113 | 113 | $('.comment_paragraph').mousedown(function(){ |
| 114 | + $("#comment-bubble").hide(); | |
| 114 | 115 | var paragraphId = $(this).data('paragraph'); |
| 115 | 116 | $(this).find('.commented-area').replaceWith(function() { |
| 116 | 117 | return $(this).html(); |
| ... | ... | @@ -120,10 +121,23 @@ jQuery(document).ready(function($) { |
| 120 | 121 | rootElement.innerHTML = lastParagraph[paragraphId]; |
| 121 | 122 | } |
| 122 | 123 | }); |
| 124 | + | |
| 125 | + function getSelectionText() { | |
| 126 | + var text = ""; | |
| 127 | + if (window.getSelection) { | |
| 128 | + text = window.getSelection().toString(); | |
| 129 | + } else if (document.selection && document.selection.type != "Control") { | |
| 130 | + text = document.selection.createRange().text; | |
| 131 | + } | |
| 132 | + return text; | |
| 133 | + } | |
| 123 | 134 | |
| 124 | 135 | //highlight area from the paragraph |
| 125 | 136 | $('.comment_paragraph').mouseup(function(event){ |
| 126 | 137 | deselectAll(); |
| 138 | + //Don't do anything if there is no selected text | |
| 139 | + if(getSelectionText().length == 0) | |
| 140 | + return; | |
| 127 | 141 | var paragraphId = $(this).data('paragraph'); |
| 128 | 142 | var currentMousePos = { x: -1, y: -1 }; |
| 129 | 143 | currentMousePos.x = event.pageX; |
| ... | ... | @@ -250,6 +264,6 @@ jQuery(document).keyup(function(e) { |
| 250 | 264 | // on press ESC key... |
| 251 | 265 | if (e.which == 27) { |
| 252 | 266 | // closing side comment box |
| 253 | - side_comment_box_opened = jQuery("div.side-comment").filter("div[style!='display: block;']").css('display', 'none'); | |
| 267 | + side_comment_box_opened = jQuery("div.side-comment").hide(); | |
| 254 | 268 | } |
| 255 | 269 | }); | ... | ... |
plugins/comment_paragraph/public/style.css
| 1 | - | |
| 2 | 1 | #article .article-comments-list, |
| 3 | 2 | #article .article-comments-list ul, |
| 4 | 3 | #article .article-comments-list li { |
| 5 | - margin: 10px 0 10px 0; | |
| 4 | + margin: 10px 0 10px 0; | |
| 6 | 5 | } |
| 7 | 6 | |
| 8 | 7 | div.article-comments-list-more{ |
| ... | ... | @@ -41,7 +40,6 @@ div.article-comments-list-more{ |
| 41 | 40 | |
| 42 | 41 | .comment_paragraph{ |
| 43 | 42 | padding: 0px; |
| 44 | - | |
| 45 | 43 | } |
| 46 | 44 | |
| 47 | 45 | .article-body{ |
| ... | ... | @@ -51,90 +49,92 @@ div.article-comments-list-more{ |
| 51 | 49 | } |
| 52 | 50 | |
| 53 | 51 | .triangle-right { |
| 54 | - position:relative; | |
| 55 | - padding:15px; | |
| 56 | - margin:1em 0 3em; | |
| 57 | - color:#fff; | |
| 58 | - background:#075698; /* default background for browsers without gradient support */ | |
| 59 | - /* css3 */ | |
| 60 | - background:-webkit-gradient(linear, 0 0, 0 100%, from(#2e88c4), to(#075698)); | |
| 61 | - background:-moz-linear-gradient(#2e88c4, #075698); | |
| 62 | - background:-o-linear-gradient(#2e88c4, #075698); | |
| 63 | - background:linear-gradient(#2e88c4, #075698); | |
| 64 | - -webkit-border-radius:10px; | |
| 65 | - -moz-border-radius:10px; | |
| 66 | - border-radius:10px; | |
| 52 | + position:relative; | |
| 53 | + padding:15px; | |
| 54 | + margin:1em 0 3em; | |
| 55 | + color:#fff; | |
| 56 | + background:#075698; /* default background for browsers without gradient support */ | |
| 57 | + /* css3 */ | |
| 58 | + background:-webkit-gradient(linear, 0 0, 0 100%, from(#2e88c4), to(#075698)); | |
| 59 | + background:-moz-linear-gradient(#2e88c4, #075698); | |
| 60 | + background:-o-linear-gradient(#2e88c4, #075698); | |
| 61 | + background:linear-gradient(#2e88c4, #075698); | |
| 62 | + -webkit-border-radius:10px; | |
| 63 | + -moz-border-radius:10px; | |
| 64 | + border-radius:10px; | |
| 67 | 65 | } |
| 68 | 66 | |
| 69 | 67 | .triangle-right:after { |
| 70 | - content: ""; | |
| 71 | - position: absolute; | |
| 72 | - bottom: -20px; | |
| 73 | - left: 50px; | |
| 74 | - border-width: 20px 0 0 20px; | |
| 75 | - border-style: solid; | |
| 76 | - border-color: #075698 transparent; | |
| 77 | - display: block; | |
| 78 | - width: 0; | |
| 68 | + content: ""; | |
| 69 | + position: absolute; | |
| 70 | + bottom: -20px; | |
| 71 | + left: 50px; | |
| 72 | + border-width: 20px 0 0 20px; | |
| 73 | + border-style: solid; | |
| 74 | + border-color: #075698 transparent; | |
| 75 | + display: block; | |
| 76 | + width: 0; | |
| 79 | 77 | } |
| 80 | 78 | |
| 81 | 79 | .triangle-border { |
| 82 | - position: relative; | |
| 83 | - padding: 15px; | |
| 84 | - margin: 1em 0 3em; | |
| 85 | - border: 5px solid #5a8f00; | |
| 86 | - color: #333; | |
| 87 | - background: #fff; | |
| 88 | - -webkit-border-radius: 10px; | |
| 89 | - -moz-border-radius: 10px; | |
| 90 | - border-radius: 10px; | |
| 80 | + position: relative; | |
| 81 | + padding: 15px; | |
| 82 | + margin: 1em 0 3em; | |
| 83 | + border: 5px solid #5a8f00; | |
| 84 | + color: #333; | |
| 85 | + background: #fff; | |
| 86 | + -webkit-border-radius: 10px; | |
| 87 | + -moz-border-radius: 10px; | |
| 88 | + border-radius: 10px; | |
| 91 | 89 | } |
| 92 | 90 | |
| 93 | 91 | .comment-picture {width: 50px;} |
| 94 | 92 | .comment-text {display: inline-block;} |
| 95 | 93 | .comment-replies .comment-text {display: inline-block;} |
| 96 | 94 | .comment-from-owner .comment-created-at { |
| 97 | - display: block; | |
| 98 | - width: 100%;} | |
| 95 | + display: block; | |
| 96 | + width: 100%; | |
| 97 | +} | |
| 99 | 98 | .comment-replies .comment-text {display: block;} |
| 100 | 99 | #article .article-comment .comment-details h4 {display: none;} |
| 101 | 100 | #article .article-comments-list .comment-replies {padding-left: 20px;} |
| 102 | 101 | #comment_title{ |
| 103 | - display: none; | |
| 102 | + display: none; | |
| 104 | 103 | } |
| 105 | 104 | |
| 106 | 105 | div[class^='comments_list_toggle_paragraph_'] { |
| 107 | - border-style: solid; | |
| 108 | - border-width: 1px; | |
| 109 | - border-color: #ccc; | |
| 110 | - padding: 5px; | |
| 111 | - background-color: whitesmoke; | |
| 112 | - width: 250px; | |
| 106 | + border-style: solid; | |
| 107 | + border-width: 1px; | |
| 108 | + border-color: #ccc; | |
| 109 | + padding: 5px; | |
| 110 | + background-color: whitesmoke; | |
| 111 | + width: 250px; | |
| 113 | 112 | } |
| 114 | 113 | |
| 115 | 114 | div[class^='comment-paragraph-loading-'] { |
| 116 | - background-color: whitesmoke; | |
| 117 | - z-index: 99; | |
| 118 | - right: -230px; | |
| 115 | + background-color: whitesmoke; | |
| 116 | + z-index: 99; | |
| 117 | + right: -230px; | |
| 119 | 118 | } |
| 120 | 119 | |
| 121 | 120 | #content .comment-balloon div[class^='comment-wrapper-']{ |
| 122 | - background: none; | |
| 121 | + background: none; | |
| 123 | 122 | } |
| 124 | 123 | |
| 125 | 124 | .side-comment{ |
| 126 | - z-index: 199; | |
| 125 | + z-index: 199; | |
| 127 | 126 | } |
| 128 | 127 | |
| 129 | 128 | .side-comments-counter { |
| 130 | - border: 1px solid #57ad68; | |
| 131 | - padding: 3px; | |
| 132 | - border-radius: 3px; | |
| 133 | - color: #666; | |
| 129 | + border: 1px solid #57ad68; | |
| 130 | + padding: 3px; | |
| 131 | + border-radius: 3px; | |
| 132 | + color: #666; | |
| 133 | + cursor: pointer; | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | #comments_list{ |
| 137 | - display: none; | |
| 137 | + display: none; | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | .article-comment-inner {border-bottom: 1px solid #ddd;} |
| ... | ... | @@ -150,7 +150,7 @@ div[class^='comment-paragraph-loading-'] { |
| 150 | 150 | .article-comment .comment-details {margin-bottom: 10px;} |
| 151 | 151 | |
| 152 | 152 | #content .comment-actions .menu-submenu ul { |
| 153 | - right: 100%; | |
| 154 | - position: absolute; | |
| 153 | + right: 100%; | |
| 154 | + position: absolute; | |
| 155 | 155 | } |
| 156 | 156 | ... | ... |