summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjessib <jessib@leap.se>2012-11-16 15:31:48 -0800
committerjessib <jessib@leap.se>2012-11-16 15:31:48 -0800
commit18a67ffdc21e44e21363f863b1a31d74b98ee3eb (patch)
treeb4f9e96e18ee9e8adaf1d5cecbc61c659f8ee9e5
parentf1e3b135eec6e0a6a02b920cdadd7adc5889f9e2 (diff)
playing around with pjax-rails but not using it yet
-rw-r--r--app/assets/javascripts/application.js5
-rw-r--r--app/views/layouts/application.html.haml3
-rw-r--r--core/lib/leap_web_core/dependencies.rb1
-rw-r--r--core/lib/leap_web_core/ui_dependencies.rb1
-rw-r--r--ui_dependencies.rb1
5 files changed, 10 insertions, 1 deletions
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index dc975d4..36a9979 100644
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -16,3 +16,8 @@
//= require users
//= require_tree .
//= require bootstrap
+//= require jquery.pjax
+
+$(function() {
+ $('a:not([data-remote]):not([data-behavior]):not([data-skip-pjax])').pjax('[data-pjax-container]');
+}); \ No newline at end of file
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index e3b7977..b0644f2 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -19,5 +19,6 @@
.row
.span12
= render 'layouts/messages' # TODO: In firefox, these are hidden by header
- = yield
+ %div{"data-pjax-container" => ""}
+ = yield
%footer
diff --git a/core/lib/leap_web_core/dependencies.rb b/core/lib/leap_web_core/dependencies.rb
index 7f6ca87..00ef515 100644
--- a/core/lib/leap_web_core/dependencies.rb
+++ b/core/lib/leap_web_core/dependencies.rb
@@ -11,6 +11,7 @@ module LeapWebCore
"haml" => "~> 3.1.7",
"bootstrap-sass" => "~> 2.0.4",
"jquery-rails" => nil,
+ "pjax_rails" => nil,
"simple_form" => nil
}
diff --git a/core/lib/leap_web_core/ui_dependencies.rb b/core/lib/leap_web_core/ui_dependencies.rb
index e0a0b86..8ca9b91 100644
--- a/core/lib/leap_web_core/ui_dependencies.rb
+++ b/core/lib/leap_web_core/ui_dependencies.rb
@@ -2,6 +2,7 @@ require "haml"
require "bootstrap-sass"
require "jquery-rails"
require "simple_form"
+require "pjax_rails"
if Rails.env == "development"
require "haml-rails"
diff --git a/ui_dependencies.rb b/ui_dependencies.rb
index 9b9f853..2c1b4aa 100644
--- a/ui_dependencies.rb
+++ b/ui_dependencies.rb
@@ -2,6 +2,7 @@ gem "haml", "~> 3.1.7"
gem "bootstrap-sass", "~> 2.1.0"
gem "jquery-rails"
gem "simple_form"
+gem "pjax_rails"
group :assets do
gem "haml-rails", "~> 0.3.4"