Commit 79c27e6a authored by Jacob Schatz's avatar Jacob Schatz

Merge branch 'emoji_award_coffee_refactoring' into 'master'

AwardsHandler follows code style conventions



See merge request !3871
parents bfc6a0e3 311c859d
...@@ -167,8 +167,8 @@ class @Notes ...@@ -167,8 +167,8 @@ class @Notes
return return
if note.award if note.award
awards_handler.addAwardToEmojiBar(note.note) awardsHandler.addAwardToEmojiBar(note.note)
awards_handler.scrollToAwards() awardsHandler.scrollToAwards()
# render note if it not present in loaded list # render note if it not present in loaded list
# or skip if rendered # or skip if rendered
...@@ -373,11 +373,11 @@ class @Notes ...@@ -373,11 +373,11 @@ class @Notes
new GLForm form new GLForm form
if scrollTo? and myLastNote? if scrollTo? and myLastNote?
# scroll to the bottom # scroll to the bottom
# so the open of the last element doesn't make a jump # so the open of the last element doesn't make a jump
$('html, body').scrollTop($(document).height()); $('html, body').scrollTop($(document).height());
$('html, body').animate({ $('html, body').animate({
scrollTop: myLastNote.offset().top - 150 scrollTop: myLastNote.offset().top - 150
}, 500, -> }, 500, ->
$noteText = form.find(".js-note-text") $noteText = form.find(".js-note-text")
$noteText.focus() $noteText.focus()
......
...@@ -15,16 +15,16 @@ ...@@ -15,16 +15,16 @@
- if current_user - if current_user
:javascript :javascript
var get_emojis_url = "#{emojis_path}"; var getEmojisUrl = "#{emojis_path}";
var post_emoji_url = "#{award_toggle_namespace_project_notes_path(@project.namespace, @project)}"; var postEmojiUrl = "#{award_toggle_namespace_project_notes_path(@project.namespace, @project)}";
var noteable_type = "#{votable.class.name.underscore}"; var noteableType = "#{votable.class.name.underscore}";
var noteable_id = "#{votable.id}"; var noteableId = "#{votable.id}";
var unicodes = #{AwardEmoji.unicode.to_json}; var unicodes = #{AwardEmoji.unicode.to_json};
window.awards_handler = new AwardsHandler( window.awardsHandler = new AwardsHandler(
get_emojis_url, getEmojisUrl,
post_emoji_url, postEmojiUrl,
noteable_type, noteableType,
noteable_id, noteableId,
unicodes unicodes
); );
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment