ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject incubator-ponymail git commit: elaborate test visibility toggle a bit
Date Fri, 02 Sep 2016 12:42:07 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/coffee-and-cake 42e2b482b -> 23f25f2f9


elaborate test visibility toggle a bit

also check that this.style is a thing.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/23f25f2f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/23f25f2f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/23f25f2f

Branch: refs/heads/coffee-and-cake
Commit: 23f25f2f916dfb6680503e10739747dd347c6ad2
Parents: 42e2b48
Author: Daniel Gruno <humbedooh@apache.org>
Authored: Fri Sep 2 14:41:44 2016 +0200
Committer: Daniel Gruno <humbedooh@apache.org>
Committed: Fri Sep 2 14:41:44 2016 +0200

----------------------------------------------------------------------
 site/js/coffee/dom_utils.coffee | 2 +-
 site/js/coffee/test.coffee      | 8 ++++++--
 site/js/ponymail-coffee.js      | 9 ++++++---
 3 files changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/23f25f2f/site/js/coffee/dom_utils.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/dom_utils.coffee b/site/js/coffee/dom_utils.coffee
index 951eb72..f4a766b 100644
--- a/site/js/coffee/dom_utils.coffee
+++ b/site/js/coffee/dom_utils.coffee
@@ -114,7 +114,7 @@ HTMLElement.prototype.show = (bool) ->
     d = 'block'
     # If no bool is provided, toggle show/hide based on current state
     if typeof bool is 'undefined'
-        d = if this.style.display == 'none' then 'block' else 'none'
+        d = if this.style and this.style.display == 'none' then 'block' else 'none'
     else if bool == false
         # bool set to false, hide stuff
         d = 'none'

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/23f25f2f/site/js/coffee/test.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/test.coffee b/site/js/coffee/test.coffee
index fdf59c5..ecf94a4 100644
--- a/site/js/coffee/test.coffee
+++ b/site/js/coffee/test.coffee
@@ -40,9 +40,13 @@ testCoffee = () ->
     p.inject([". Here's a textNode added afterwards", new HTML('br')])
     
     # Make an object we can hide when clicked on, using the show() prototype
-    hider = new HTML('b', { onclick: 'testToggle(this);'}, "Click here to hide this text!")
+    hider = new HTML('b', { onclick: 'testToggle(this);'}, "Click here to hide this text
for a second!")
     p.inject(hider)
     
     
 testToggle = (div) ->
-    div.show()
\ No newline at end of file
+    div.show()
+    window.setTimeout(
+        () ->
+            div.show()
+        ,1000)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/23f25f2f/site/js/ponymail-coffee.js
----------------------------------------------------------------------
diff --git a/site/js/ponymail-coffee.js b/site/js/ponymail-coffee.js
index 5188c57..7906288 100644
--- a/site/js/ponymail-coffee.js
+++ b/site/js/ponymail-coffee.js
@@ -275,7 +275,7 @@ HTMLElement.prototype.show = function(bool) {
   var b, d;
   d = 'block';
   if (typeof bool === 'undefined') {
-    d = this.style.display === 'none' ? 'block' : 'none';
+    d = this.style && this.style.display === 'none' ? 'block' : 'none';
   } else if (bool === false) {
     d = 'none';
   } else if (bool === true) {
@@ -667,10 +667,13 @@ testCoffee = function() {
   p.inject([". Here's a textNode added afterwards", new HTML('br')]);
   hider = new HTML('b', {
     onclick: 'testToggle(this);'
-  }, "Click here to hide this text!");
+  }, "Click here to hide this text for a second!");
   return p.inject(hider);
 };
 
 testToggle = function(div) {
-  return div.show();
+  div.show();
+  return window.setTimeout(function() {
+    return div.show();
+  }, 1000);
 };


Mime
View raw message