Skip to content

Commit

Permalink
Do not select message by click
Browse files Browse the repository at this point in the history
Go to message from search by click
  • Loading branch information
endenwer committed Apr 8, 2016
1 parent 642cb80 commit 74c5e46
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
18 changes: 10 additions & 8 deletions app/views/telegram_messages/index.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,23 @@ $('.archive-form').css({
})

$(".telegram-message").click(function(){
if ($(this).hasClass("telegram-selected-message")) {
$(this).removeClass("telegram-selected-message")
$(this).find(".telegram-message-checkbox").prop("checked", false);
} else {
$(this).addClass("telegram-selected-message")
$(this).find(".telegram-message-checkbox").prop("checked", true);
}

// Go to message from search
if ($("#telegram-search-input").prop("value") != ""){
clearSearch()
scrollTo($(".archive-form"), $(this))
}
})

$(".telegram-message-checkbox").click(function(){
messageId = $(this).prop("value")
message = $("#telegram_message_" + messageId)
if ($(this).prop("checked")){
message.addClass("telegram-selected-message")
} else {
message.removeClass("telegram-selected-message")
}
})

$(".telegram-message").hover(function(){
$(this).find(".telegram-message-checkbox").css("visibility", "visible");
}, function(){
Expand Down
9 changes: 1 addition & 8 deletions assets/stylesheets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

.telegram-message-checkbox{
float: right;
margin-left: 10px;
margin-right: 20px;
visibility: hidden;
}

Expand Down Expand Up @@ -95,13 +95,6 @@
font-size: 0.85em;
}

.telegram-goto-link{
color: #adadad !important;
font-size: .85em;
cursor: pointer;
display:none;
}

.user-color-1{
color: #8365ab;
}
Expand Down

0 comments on commit 74c5e46

Please sign in to comment.