Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed retort to work with latest Discourse. #31

Merged
merged 5 commits into from Sep 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions assets/javascripts/discourse/components/retort-picker.js.es6
Expand Up @@ -4,7 +4,6 @@ import { emojiUrlFor } from 'discourse/lib/text'
const siteSettings = Discourse.SiteSettings

export default EmojiPicker.extend({

_scrollTo() {
if (siteSettings.retort_limited_emoji_set) {
return
Expand All @@ -15,11 +14,11 @@ export default EmojiPicker.extend({

_loadCategoriesEmojis() {
if (siteSettings.retort_limited_emoji_set) {
const $picker = $('.emoji-picker')
const $picker = this.$('.emoji-picker')
$picker.html("")
siteSettings.retort_allowed_emojis.split('|').map((code) => {
$picker.append(`<button type="button" title="${code}" class="emoji" />`)
$(`button.emoji[title="${code}"]`).css("background-image", `url("${emojiUrlFor(code)}")`)
this.$(`button.emoji[title="${code}"]`).css("background-image", `url("${emojiUrlFor(code)}")`)
})
this._bindEmojiClick($picker);
} else {
Expand Down
2 changes: 1 addition & 1 deletion plugin.rb
Expand Up @@ -27,7 +27,7 @@ class Engine < ::Rails::Engine
end

class ::Retort::RetortsController < ApplicationController
before_filter :verify_post_and_user, only: :update
before_action :verify_post_and_user, only: :update

def update
retort.toggle_user(current_user)
Expand Down