[open-ils-commits] [GIT] Evergreen ILS branch master updated. fd70fb824fd606ee8b2d1d2870f89e5c117f9e60

Evergreen Git git at git.evergreen-ils.org
Wed Sep 14 15:49:59 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  fd70fb824fd606ee8b2d1d2870f89e5c117f9e60 (commit)
      from  f44becacb7548894873b4573b8a5aad48a320dae (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit fd70fb824fd606ee8b2d1d2870f89e5c117f9e60
Author: Mike Rylander <mrylander at gmail.com>
Date:   Wed Sep 14 15:43:55 2011 -0400

    Make sure we only render the most recent request to the canvas, so a laggy network does not cause double rendering or stale display
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/web/js/dojo/openils/BibTemplate.js b/Open-ILS/web/js/dojo/openils/BibTemplate.js
index 5941388..8c81447 100644
--- a/Open-ILS/web/js/dojo/openils/BibTemplate.js
+++ b/Open-ILS/web/js/dojo/openils/BibTemplate.js
@@ -242,6 +242,7 @@ if(!dojo._hasResource["openils.BibTemplate"]) {
 
         constructor : function(kwargs) {
             this.place = kwargs.place;
+            this.empty = kwargs.empty;
             this.root = kwargs.root;
             this.xml = kwargs.xml;
             this.feed_uri = kwargs.uri;
@@ -253,19 +254,30 @@ if(!dojo._hasResource["openils.BibTemplate"]) {
             this.relativePosition = 'last';
             if (this.reverseSort) this.relativePosition = 'first';
 
+            this.horizon = new Date().getTime();
+            var horiz = parseInt(this.root.getAttribute('horizon'));
+
+            if (isNaN(horiz) || this.horizon >= horiz) 
+                this.root.setAttribute('horizon', this.horizon);
+
             if (this.nodelay) this.render();
         },
 
         render : function () {
             var me = this;
+
             var process_feed = function (xmldoc) {
-                dojo.query( me.item_query, xmldoc ).forEach(
-                    function (item) {
-                        var template = me.root.cloneNode(true);
-                        dojo.place( template, me.place, me.relativePosition );
-                        new openils.BibTemplate({ delay : false, xml : item, root : template });
-                    }
-                );
+		if (parseInt(me.horizon) >= parseInt(me.root.getAttribute('horizon'))) {
+                    if (me.empty == true) dojo.empty(me.place);
+                    me.root.setAttribute('horizon', this.horizon);
+                    dojo.query( me.item_query, xmldoc ).forEach(
+                        function (item) {
+                            var template = me.root.cloneNode(true);
+                            dojo.place( template, me.place, me.relativePosition );
+                            new openils.BibTemplate({ delay : false, xml : item, root : template });
+                        }
+                    );
+                }
             };
 
             if (this.xml) {

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/web/js/dojo/openils/BibTemplate.js |   26 +++++++++++++++++++-------
 1 files changed, 19 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list