Skip to content

Commit f6d858a

Browse files
committed
fix logo pjaxload
1 parent affb1ee commit f6d858a

File tree

2 files changed

+6
-28
lines changed

2 files changed

+6
-28
lines changed

src/javascript/binary/base/page.js

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -263,15 +263,12 @@ Client.prototype = {
263263
is_ok = false;
264264
}
265265

266-
// allowed markets
267266
if(this.is_logged_in) {
268267
if(
269268
!this.get_storage_value('is_virtual') &&
270-
!this.get_storage_value('allowed_markets') &&
271269
Cookies.get('residence') &&
272270
!this.get_storage_value('has_reality_check')
273271
) {
274-
$('#topMenuStartBetting').addClass('invisible');
275272
BinarySocket.send({
276273
'landing_company': Cookies.get('residence'),
277274
'passthrough': {
@@ -300,15 +297,11 @@ Client.prototype = {
300297
},
301298
response_landing_company: function(response) {
302299
if (!response.hasOwnProperty('error')) {
303-
var allowed_markets = response.legal_allowed_markets;
304300
var company = response.name;
305301
var has_reality_check = response.has_reality_check;
306302

307-
this.set_storage_value('allowed_markets', allowed_markets.length === 0 ? '' : allowed_markets.join(','));
308303
this.set_storage_value('landing_company_name', company);
309304
this.set_storage_value('has_reality_check', has_reality_check);
310-
311-
page.header.menu.register_dynamic_links();
312305
}
313306
},
314307
response_authorize: function(response) {
@@ -335,7 +328,7 @@ Client.prototype = {
335328
},
336329
clear_storage_values: function() {
337330
var that = this;
338-
var items = ['currencies', 'allowed_markets', 'landing_company_name', 'is_virtual',
331+
var items = ['currencies', 'landing_company_name', 'is_virtual',
339332
'has_reality_check', 'tnc_status', 'session_duration_limit', 'session_start'];
340333
items.forEach(function(item) {
341334
that.set_storage_value(item, '');
@@ -654,19 +647,6 @@ Menu.prototype = {
654647

655648
return { item: item, subitem: subitem };
656649
},
657-
register_dynamic_links: function() {
658-
var stored_market = page.url.param('market') || LocalStore.get('bet_page.market') || 'forex';
659-
var allowed_markets = page.client.get_storage_value('allowed_markets');
660-
if(!allowed_markets && page.client.is_logged_in && !TUser.get().is_virtual) {
661-
return;
662-
}
663-
664-
var markets_array = allowed_markets ? allowed_markets.split(',') : [];
665-
if(!TUser.get().is_virtual && markets_array.indexOf(stored_market) < 0) {
666-
stored_market = markets_array[0];
667-
LocalStore.set('bet_page.market', stored_market);
668-
}
669-
},
670650
check_payment_agent: function(is_authenticated_payment_agent) {
671651
if(is_authenticated_payment_agent) {
672652
$('#topMenuPaymentAgent').removeClass('invisible');
@@ -683,7 +663,6 @@ var Header = function(params) {
683663
Header.prototype = {
684664
on_load: function() {
685665
this.show_or_hide_login_form();
686-
this.register_dynamic_links();
687666
this.logout_handler();
688667
this.check_risk_classification();
689668
if (!$('body').hasClass('BlueTopBack')) {
@@ -746,10 +725,6 @@ Header.prototype = {
746725
}
747726
$(".login-id-list").html(loginid_select);
748727
},
749-
register_dynamic_links: function() {
750-
$('#logo').attr('href', page.url.url_for(this.client.is_logged_in ? japanese_client() ? 'jptrading' : 'trading' : ''));
751-
this.menu.register_dynamic_links();
752-
},
753728
start_clock_ws: function() {
754729
function getTime() {
755730
clock_started = true;
@@ -837,7 +812,7 @@ Header.prototype = {
837812
LocalStore.remove('client.tokens');
838813
LocalStore.set('reality_check.ack', 0);
839814
sessionStorage.removeItem('client_status');
840-
var cookies = ['login', 'loginid', 'loginid_list', 'email', 'settings', 'reality_check', 'affiliate_token', 'affiliate_tracking', 'residence', 'allowed_markets'];
815+
var cookies = ['login', 'loginid', 'loginid_list', 'email', 'settings', 'reality_check', 'affiliate_token', 'affiliate_tracking', 'residence'];
841816
var domains = [
842817
'.' + document.domain.split('.').slice(-2).join('.'),
843818
'.' + document.domain,
@@ -1013,6 +988,9 @@ var Page = function() {
1013988
this.header = new Header({ user: this.user, client: this.client, url: this.url});
1014989
this.contents = new Contents(this.client, this.user);
1015990
this._lang = null;
991+
$('#logo').on('click', function() {
992+
load_with_pjax(page.url.url_for(page.client.is_logged_in ? japanese_client() ? 'jptrading' : 'trading' : ''));
993+
});
1016994
};
1017995

1018996
Page.prototype = {

src/templates/global/header.html.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<div class='gr-12'>
3131
<div class='gr-row gr-row-align-middle'>
3232
<div class='gr-3 gr-2-m gr-2-p gr-padding-10'>
33-
<a id="logo" class="pjaxload" href="[% request.url_for('/') %]">
33+
<a id="logo" href="javascript:;">
3434
<div class='gr-row'>
3535
<div class='gr-3 gr-12-m gr-12-p gr-no-gutter'>
3636
<img class='responsive' src="[% request.url_for('images/pages/binary-symbol-logo.svg') %]" />

0 commit comments

Comments
 (0)