From a26dc34a7be72f166f4160aa68fa5f61d4077061 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Tue, 2 Oct 2012 22:43:55 +0300 Subject: [PATCH] Fix broken mobile bookmarklet, isse #3613 --- app/controllers/status_messages_controller.rb | 12 +++++++++++- app/views/status_messages/bookmarklet.mobile.haml | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index 512f1390172..33ff1a2ce40 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -11,7 +11,17 @@ class StatusMessagesController < ApplicationController :mobile, :json - layout 'blank', :only => [ :bookmarklet ] + layout :bookmarklet_layout, :only => :bookmarklet + + # Define bookmarklet layout depending on whether + # user is in mobile or desktop mode + def bookmarklet_layout + if request.format == :mobile + 'application' + else + 'blank' + end + end # Called when a user clicks "Mention" on a profile page # @param person_id [Integer] The id of the person to be mentioned diff --git a/app/views/status_messages/bookmarklet.mobile.haml b/app/views/status_messages/bookmarklet.mobile.haml index 8ccafc26aac..64ccf6189a9 100644 --- a/app/views/status_messages/bookmarklet.mobile.haml +++ b/app/views/status_messages/bookmarklet.mobile.haml @@ -18,4 +18,4 @@ }); - content_for(:head) do - = javascript_include_tag :mobile \ No newline at end of file + = javascript_include_tag :jquery, :mobile