mirror of
https://github.com/kbparagua/paloma
synced 2023-03-27 23:21:17 -04:00
test with jquery.turbolinks
This commit is contained in:
parent
dbd4b0d155
commit
446f89e5f3
4 changed files with 10 additions and 12 deletions
|
@ -3,14 +3,6 @@
|
|||
<div class="js-paloma-hook" data-id="<%= id %>">
|
||||
<script type="text/javascript">
|
||||
(function(){
|
||||
// Do not continue if Paloma not found.
|
||||
if (window['Paloma'] === undefined) {
|
||||
if (window['console'] !== undefined) {
|
||||
console.warn("Paloma not found. Require it in your application.js.");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Paloma.env = '<%= Rails.env %>';
|
||||
|
||||
// Remove any callback details if any
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
source 'https://rubygems.org'
|
||||
|
||||
gem 'selenium-webdriver'
|
||||
gem 'jquery-turbolinks'
|
||||
gemspec :path => '../'
|
|
@ -11,14 +11,17 @@
|
|||
// GO AFTER THE REQUIRES BELOW.
|
||||
//
|
||||
//= require jquery
|
||||
//= require jquery.turbolinks
|
||||
//= require jquery_ujs
|
||||
//= require turbolinks
|
||||
//= require paloma
|
||||
//= require_tree .
|
||||
|
||||
|
||||
// $(document).on('page:restore', function(){
|
||||
// Uncomment if jquery.turbolinks is not used.
|
||||
// $(document).on('page:load', function(){
|
||||
// Paloma.executeHook();
|
||||
// Paloma.engine.start();
|
||||
// });
|
||||
|
||||
|
||||
|
|
8
vendor/assets/javascripts/paloma/init.js
vendored
8
vendor/assets/javascripts/paloma/init.js
vendored
|
@ -3,15 +3,17 @@ window.Paloma = window.Paloma || {};
|
|||
//
|
||||
// Do nothing if there is no available console.
|
||||
//
|
||||
if (!window['console']){ Paloma.log = Paloma.warn = function(msg){}; }
|
||||
if ( !window['console'] ){
|
||||
Paloma.log = Paloma.warn = function(msg){};
|
||||
}
|
||||
else {
|
||||
Paloma.warn = function(msg){
|
||||
if(Paloma.env != 'development') return;
|
||||
if (Paloma.env != 'development'){ return; }
|
||||
console.warn(msg);
|
||||
};
|
||||
|
||||
Paloma.log = function(msg){
|
||||
if(Paloma.env != 'development') return;
|
||||
if (Paloma.env != 'development'){ return; }
|
||||
console.log(msg);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue