Mercurial > hg > nodescore
comparison www/m/js/nodescore-client.js @ 18:6ad0cde69558
added visibility toggle to preview div
author | tzara <rc-web@kiben.net> |
---|---|
date | Mon, 09 Jul 2012 11:02:42 +0100 |
parents | e05eede75e0d |
children | a56434dee146 |
comparison
equal
deleted
inserted
replaced
17:156151cf3641 | 18:6ad0cde69558 |
---|---|
82 $("#live").html($("#unit"+unit).html()); | 82 $("#live").html($("#unit"+unit).html()); |
83 | 83 |
84 } | 84 } |
85 | 85 |
86 //////////////////////////////////////////////// | 86 //////////////////////////////////////////////// |
87 // keyboard controls | |
88 // SPACE to toggle visibilty of preview | |
89 // etc | |
90 // etc | |
91 //////////////////////////////////////////////// | |
92 function toggle_visibility(id) { | |
93 var e = document.getElementById(id); | |
94 if(e.style.display == 'block') | |
95 e.style.display = 'none'; | |
96 else | |
97 e.style.display = 'block'; | |
98 } | |
99 | |
100 $(document).keypress(function(e){ | |
101 var checkWebkitandIE=(e.which==32 ? 1 : 0); | |
102 var checkMoz=(e.which==32 ? 1 : 0); | |
103 if (checkWebkitandIE || checkMoz) { | |
104 toggle_visibility('preview') | |
105 } | |
106 }); | |
107 | |
108 //////////////////////////////////////////////// |