fix glitch with switching between new and classic
This commit is contained in:
parent
e19892584f
commit
76ea483a2a
|
@ -246,7 +246,11 @@ class QvitterPlugin extends Plugin {
|
|||
}
|
||||
}
|
||||
|
||||
$action->inlineScript('var toggleQvitterAPIURL = \''.common_path('', true).'api/qvitter/toggle_qvitter.json\'; var toggleText = \'New '.str_replace("'","\'",common_config('site','name')).'\';var qvitterEnabled = '.$qvitter_enabled.';');
|
||||
$action->inlineScript(' var toggleQvitterAPIURL = \''.common_path('', true).'api/qvitter/toggle_qvitter.json\';
|
||||
var toggleText = \'New '.str_replace("'","\'",common_config('site','name')).'\';
|
||||
var qvitterEnabled = '.$qvitter_enabled.';
|
||||
var qvitterAllLink = \''.common_local_url('all', array('nickname' => $user->nickname)).'\';
|
||||
');
|
||||
$action->script($this->path('js/toggleqvitter.js'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -406,14 +406,14 @@ $('#faq-link').click(function(){
|
|||
|
||||
/* ·
|
||||
·
|
||||
· Classic Link, toggle setting in api and reload page when finished
|
||||
· Classic Link, toggle setting in api and redirect to /all
|
||||
·
|
||||
· · · · · · · · · · · · · */
|
||||
|
||||
$('#classic-link').click(function(){
|
||||
getFromAPI('qvitter/toggle_qvitter.json',function(data){
|
||||
if(data.success === true) {
|
||||
location.reload(); // reload
|
||||
window.location.href = window.siteInstanceURL + window.loggedIn.screen_name + '/all';
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
|
||||
if(qvitterEnabled) {
|
||||
$('#site_nav_global_primary').find('.nav').first().prepend('<li id="toggleqvitter"><a href="' + $('.home.bookmark').attr('href') + '">' + toggleText + '</a></li>');
|
||||
$('#site_nav_global_primary').find('.nav').first().prepend('<li id="toggleqvitter"><a href="' + qvitterAllLink + '">' + toggleText + '</a></li>');
|
||||
}
|
||||
else {
|
||||
$('#site_nav_global_primary').find('.nav').first().prepend('<li id="toggleqvitter"><a href="' + location.href + '">' + toggleText + '</a></li>');
|
||||
|
@ -51,7 +51,7 @@ else {
|
|||
e.preventDefault();
|
||||
$.get(toggleQvitterAPIURL,function(data){
|
||||
if(data.success === true) {
|
||||
location.reload(); // reload
|
||||
window.location.href = qvitterAllLink;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user