app/helpers/familiarity/application_helper.rb in familiarity-0.2.1 vs app/helpers/familiarity/application_helper.rb in familiarity-0.2.2
- old
+ new
@@ -1,10 +1,11 @@
module Familiarity
module ApplicationHelper
def familiaritySwitchBoard
content_tag('script') do
- raw "$(document).on(\"page:change\", function () {FamiliarityAdmin.familiaritySwitchBoard();});"
+ # raw "$(document).on(\"page:change\", function () {FamiliarityAdmin.familiaritySwitchBoard();});"
+ raw "FamiliarityAdmin.familiaritySwitchBoard();"
end
end
def familiarityView(options={})
_options= {
@@ -15,18 +16,18 @@
traverse_back: true,
remember_duration: 30 #In Days
}.merge(options)
content_tag('script') do
- raw <<END_SQL
+ raw <<END_SCRIPT
var cn = 'familiarity_' + '#{request.path}'.replace(/\\//g,'A');
var familiarity = new Familiarity(#{_options.to_json});
if (typeof $.cookie(cn) == "undefined")
{
familiarity.familiarityView(true);
console.log($.cookie(cn, new Date(), { expires: #{_options[:remember_duration]} }));
}
-END_SQL
+END_SCRIPT
end
end
end
end