Browse Source

examples: Pop up the console on new output for three seconds if hidden.

Ryan C. Gordon 1 year ago
parent
commit
900213e16e
1 changed files with 6 additions and 0 deletions
  1. 6 0
      examples/template.html

+ 6 - 0
examples/template.html

@@ -156,6 +156,12 @@
           var element = document.getElementById('output');
           var element = document.getElementById('output');
           if (element) element.value = ''; // clear browser cache
           if (element) element.value = ''; // clear browser cache
           return function(text) {
           return function(text) {
+            var elem = document.getElementById('output-container');
+            if (elem.style['top'] == '') {
+                elem.style['top'] = '50%';
+                setTimeout(function() { elem.style['top'] = ''; }, 3000);
+            }
+
             if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
             if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
             // These replacements are necessary if you render to raw HTML
             // These replacements are necessary if you render to raw HTML
             //text = text.replace(/&/g, "&");
             //text = text.replace(/&/g, "&");