Просмотр исходного кода

Ne charge les raccourcis que sur la page principale

Marien Fressinaud 12 лет назад
Родитель
Сommit
d4f636f26a
2 измененных файлов с 8 добавлено и 4 удалено
  1. 5 3
      app/views/javascript/main.phtml
  2. 3 1
      public/scripts/main.js

+ 5 - 3
app/views/javascript/main.phtml

@@ -17,14 +17,16 @@
 			'go_website:"', $s['go_website'], '",',
 			'prev_entry:"', $s['prev_entry'], '",',
 			'next_entry:"', $s['next_entry'], '"',
-		"}";
+		"},";
 
 	$mail = Session::param ('mail', 'null');
 	if ($mail != 'null') {
 		$mail = '"' . $mail . '"';
 	}
-	echo ',use_persona=', login_is_conf ($this->conf) ? 'true' : 'false',
+	echo 'use_persona=', login_is_conf ($this->conf) ? 'true' : 'false',
 		',url_freshrss="', _url ('index', 'index'), '",',
 		'url_login="', _url ('index', 'login'), '",',
 		'url_logout="', _url ('index', 'logout'), '",',
-		'current_user_mail=', $mail, ";\n";
+		'current_user_mail=', $mail, ",\n";
+
+	echo 'load_shortcuts=', Request::controllerName () === 'index' && Request::actionName () === 'index' ? 'true' : 'false', ";\n";

+ 3 - 1
public/scripts/main.js

@@ -591,7 +591,9 @@ function init_all() {
 	$stream = $('#stream');
 	init_posts();
 	init_column_categories();
-	init_shortcuts();
+	if (load_shortcuts) {
+		init_shortcuts();
+	}
 	init_stream_delegates($stream);
 	init_nav_entries();
 	init_templates();