[gimp-web/testing] Prevent unnecessary reloads
- From: Michael Schumacher <schumaml src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp-web/testing] Prevent unnecessary reloads
- Date: Tue, 28 Jul 2015 23:00:54 +0000 (UTC)
commit 474240fdcb3b6fbb934f6407e68178095289502e
Author: Michael Schumacher <schumaml gmx de>
Date: Wed Jul 29 01:00:31 2015 +0200
Prevent unnecessary reloads
includes/wgo.js | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/includes/wgo.js b/includes/wgo.js
index dc13736..b9b22f5 100644
--- a/includes/wgo.js
+++ b/includes/wgo.js
@@ -26,15 +26,17 @@ function mangleforOpera() {
//provide download page depending on OS
function renderDownload(platform) {
- $("#downloads").html("<div id=\"moreos\"></div>\n<div id=\"os\"> </div>\n<hr />\n<div
id=\"source\"> </div>\n");
- $("#moreos").html("Show downloads for <a href=\"javascript:renderDownload('oslinux');\">GNU/Linux</a>" +
+ if ( $("#downloads").is(':empty') ) {
+ $("#downloads").html("<div id=\"moreos\"></div>\n<div id=\"os\"> </div>\n<hr />\n<div
id=\"source\"> </div>\n");
+ $("#moreos").html("Show downloads for <a
href=\"javascript:renderDownload('oslinux');\">GNU/Linux</a>" +
" | <a href=\"javascript:renderDownload('osmac');\">OS X</a>" +
" | <a href=\"javascript:renderDownload('oswindows');\">Microsoft
Windows</a>" +
" | <a href=\"javascript:renderDownload('all');\">All</a>");
- // always have all the divs
- $("#os").html("<div id=\"oslinux\"></div>\n<div id=\"osmac\"></div>\n<div id=\"oswindows\"></div>\n");
-
+ // always have all the divs
+ $("#os").html("<div id=\"oslinux\"></div>\n<div id=\"osmac\"></div>\n<div id=\"oswindows\"></div>\n");
+ }
+
// decide which one to show
if (platform == undefined) {
platform = "os" + $.browser.OS.toLowerCase();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]