change location using href in javascript for phonegap support

This commit is contained in:
2013-04-11 08:34:33 +02:00
parent 599541f430
commit b6a65d981f
3 changed files with 6 additions and 3 deletions
@@ -135,7 +135,7 @@ function redirect_to(mapping, variables){
vars.push(name + '=' +variables[name]); vars.push(name + '=' +variables[name]);
Qstorage.setItem(name, variables[name]); Qstorage.setItem(name, variables[name]);
} }
window.location = QMobile.root_url() + path_mapping[mapping] + '.html' window.location.href = QMobile.root_url() + path_mapping[mapping] + '.html'
} }
function direct_to_site(mapping, variables){ function direct_to_site(mapping, variables){
variables || (variables = {}); variables || (variables = {});
+4 -1
View File
@@ -4,6 +4,7 @@ class ApplicationController < ActionController::Base
protect_from_forgery protect_from_forgery
rescue_from SimplyStored::RecordNotFound, with: :show_404 rescue_from SimplyStored::RecordNotFound, with: :show_404
private private
def authorize_cmtool def authorize_cmtool
@@ -15,11 +16,13 @@ private
uri = URI.parse(event_host) uri = URI.parse(event_host)
Net::HTTP.post_form(uri, :message => message.to_json) Net::HTTP.post_form(uri, :message => message.to_json)
end end
def broadcast_supplier(sid, event, data = {}) def broadcast_supplier(sid, event, data = {})
message = {channel: "/supplier/#{sid}", data: {event: event, data: data}} message = {channel: "/supplier/#{sid}", data: {event: event, data: data}}
uri = URI.parse(event_host) uri = URI.parse(event_host)
Net::HTTP.post_form(uri, :message => message.to_json) Net::HTTP.post_form(uri, :message => message.to_json)
end end
def set_locale def set_locale
I18n.locale = (params[:locale].presence || :nl).to_sym I18n.locale = (params[:locale].presence || :nl).to_sym
end end
@@ -31,6 +34,7 @@ private
end end
"theme1" "theme1"
end end
def check_active_list_state def check_active_list_state
if current_user.try(:active_list_id) if current_user.try(:active_list_id)
unless active_list.active? unless active_list.active?
@@ -38,7 +42,6 @@ private
redirect_to user_root_path, alert: t('messages.the_list_has_been_closed', list: List.model_name.human) redirect_to user_root_path, alert: t('messages.the_list_has_been_closed', list: List.model_name.human)
end end
end end
end end
def active_list def active_list
+1 -1
View File
@@ -22,7 +22,7 @@
td td
td.currency td.currency
strong.list-total-amount strong.list-total-amount
script#active-list-order-template[type="text/html"]= render 'active_list_order.mustache' script#active-list-order-template[type="text/html"]= mustache_template 'active_list_order'
- content_for :footer do - content_for :footer do
javascript: javascript:
jQuery(function(){ jQuery(function(){