]> git.wh0rd.org Git - tt-rss.git/commitdiff
iui: less tweaks
authorAndrew Dolgov <fox@bah.org.ru>
Fri, 18 Dec 2009 08:59:40 +0000 (11:59 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Fri, 18 Dec 2009 08:59:40 +0000 (11:59 +0300)
lib/iui/iui.js

index d47cbddb25581797991902a2b3fb227faed3a9fa..6b7b16b4e63b98a75e566f7e9976d3641c072afc 100644 (file)
@@ -66,7 +66,7 @@ window.iui =
                }
        },
 
-       showPageByHref: function(href, args, method, replace, cb, backwards)
+       showPageByHref: function(href, args, method, replace, cb, bw)
        {
                var req = new XMLHttpRequest();
                req.onerror = function()
@@ -85,7 +85,7 @@ window.iui =
                                {
                                        var frag = document.createElement("div");
                                        frag.innerHTML = req.responseText;
-                                       iui.insertPages(frag.childNodes, backwards);
+                                       iui.insertPages(frag.childNodes, bw);
                                }
                                if (cb)
                                        setTimeout(cb, 1000, true);
@@ -106,7 +106,7 @@ window.iui =
                }
        },
        
-       insertPages: function(nodes, backwards)
+       insertPages: function(nodes, bw)
        {
                var targetPage;
                for (var i = 0; i < nodes.length; ++i)
@@ -131,7 +131,7 @@ window.iui =
                }
 
                if (targetPage)
-                       iui.showPage(targetPage, backwards);     
+                       iui.showPage(targetPage, bw);    
        },
 
        getSelectedPage: function()
@@ -203,9 +203,9 @@ addEventListener("click", function(event)
                        iui.showPage($(link.hash.substr(1)));
                        setTimeout(unselect, 500);
                }
-               if (link == $("backButton")) {
+               else if (link == $("backButton"))
                        history.back();
-               else if (link.getAttribute("type") == "submit")
+               else if (link.getAttribute("type") == "submit")
                {
                        var form = findParent(link, "form");
                        if (form.target == "_self")
@@ -233,10 +233,8 @@ addEventListener("click", function(event)
                else if (!link.target)
                {
                        link.setAttribute("selected", "progress");
-
-                       var backwards = link.getAttribute("backwards");
-
-                       iui.showPageByHref(link.href, null, null, null, unselect, backwards);
+                       var bw = link.getAttribute("backwards");
+                       iui.showPageByHref(link.href, null, null, null, unselect, bw);
                }
                else
                        return;
@@ -363,8 +361,7 @@ function updatePage(page, fromPage)
                }
                else
                        backButton.style.display = "none";
-       }        
-
+       }       
 
        var backButton = $("myBackButton");
        if (backButton)