Unverified Commit a5f538b9 authored by Benjamin Neff's avatar Benjamin Neff Committed by Steffen van Bergerem
Browse files

Load jquery in the head on mobile

Some pages need jquery in the head and instead of loading it twice on
these pages, it is better and easier to load it in the head on all
pages. It should be in the cache after the first load anyway.

closes #7086
parent 546f9096
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
* Invalidate sessions with invalid CSRF tokens [#7050](https://github.com/diaspora/diaspora/pull/7050)
* Liking a post will no longer update its interacted timestamp [#7030](https://github.com/diaspora/diaspora/pull/7030)
* Improve W3C compliance [#7068](https://github.com/diaspora/diaspora/pull/7068)
* Load jQuery in the head on mobile [#7086](https://github.com/diaspora/diaspora/pull/7086)

## Bug fixes
* Post comments no longer get collapsed when interacting with a post [#7040](https://github.com/diaspora/diaspora/pull/7040)
+0 −2
Original line number Diff line number Diff line
@@ -2,8 +2,6 @@
-#   licensed under the Affero General Public License version 3 or later.  See
-#   the COPYRIGHT file.

= javascript_include_tag :jquery

:javascript
  $(document).ready(function () {
    var data = $.parseJSON( "#{escape_javascript(@contacts_json)}" ),
+2 −1
Original line number Diff line number Diff line
@@ -48,6 +48,8 @@
    - if Rails.env.test?
      = stylesheet_link_tag :poltergeist_disable_transition, media: "all"

    = jquery_include_tag

    = yield(:head)

    = include_gon(:camel_case => true)
@@ -64,7 +66,6 @@
        = yield

    / javascripts at the bottom
    = jquery_include_tag
    = javascript_include_tag "mobile/mobile"
    = load_javascript_locales
    = include_chartbeat
+0 −2
Original line number Diff line number Diff line
- content_for :head do
  - if mobile
    = javascript_include_tag :jquery
  :javascript
    $(document).ready(function () {
      var data = $.parseJSON( '#{@tags_array.to_json.gsub("'", "\\\\'")}' ),
+0 −3
Original line number Diff line number Diff line
@@ -19,6 +19,3 @@
      $("#status_message_text").val(contents);
    }
  });

- content_for(:head) do
  = javascript_include_tag :jquery
Loading