Fossil SCM

Restrict pikchr svg/source toggle to clicks, per forum feedback.

stephan 2020-09-15 14:54 trunk
Commit 4e757d8c4872802291ff9352002d9d03b6fb3d965c52927afaed675baaccd1c1
1 file changed +9 -7
--- src/fossil.pikchr.js
+++ src/fossil.pikchr.js
@@ -155,17 +155,19 @@
155155
Toggle the buttons on only when the mouse is in the parent
156156
widget's area or the user taps on that area. This seems much
157157
less "busy" than having them always visible and slightly in the way.
158158
It also means that we can make them a bit larger.
159159
*/
160
- parent.addEventListener('mouseenter', function(ev){
161
- if(ev.target === parent) D.removeClass(buttons, 'hidden');
162
- }, true);
163
- parent.addEventListener('mouseleave', function(ev){
164
- if(ev.target === parent) D.addClass(buttons, 'hidden');
165
- }, true);
166
- /* mouseenter/leave work well... but only if there's a mouse. */
160
+ if(0){ /* Mouse enter/leave triggers currently disabled by request */
161
+ parent.addEventListener('mouseenter', function(ev){
162
+ if(ev.target === parent) D.removeClass(buttons, 'hidden');
163
+ }, true);
164
+ parent.addEventListener('mouseleave', function(ev){
165
+ if(ev.target === parent) D.addClass(buttons, 'hidden');
166
+ }, true);
167
+ /* mouseenter/leave work well... but only if there's a mouse. */
168
+ }
167169
parent.addEventListener('click', function(ev){
168170
ev.preventDefault();
169171
ev.stopPropagation();
170172
D.toggleClass(buttons, 'hidden');
171173
}, false);
172174
--- src/fossil.pikchr.js
+++ src/fossil.pikchr.js
@@ -155,17 +155,19 @@
155 Toggle the buttons on only when the mouse is in the parent
156 widget's area or the user taps on that area. This seems much
157 less "busy" than having them always visible and slightly in the way.
158 It also means that we can make them a bit larger.
159 */
160 parent.addEventListener('mouseenter', function(ev){
161 if(ev.target === parent) D.removeClass(buttons, 'hidden');
162 }, true);
163 parent.addEventListener('mouseleave', function(ev){
164 if(ev.target === parent) D.addClass(buttons, 'hidden');
165 }, true);
166 /* mouseenter/leave work well... but only if there's a mouse. */
 
 
167 parent.addEventListener('click', function(ev){
168 ev.preventDefault();
169 ev.stopPropagation();
170 D.toggleClass(buttons, 'hidden');
171 }, false);
172
--- src/fossil.pikchr.js
+++ src/fossil.pikchr.js
@@ -155,17 +155,19 @@
155 Toggle the buttons on only when the mouse is in the parent
156 widget's area or the user taps on that area. This seems much
157 less "busy" than having them always visible and slightly in the way.
158 It also means that we can make them a bit larger.
159 */
160 if(0){ /* Mouse enter/leave triggers currently disabled by request */
161 parent.addEventListener('mouseenter', function(ev){
162 if(ev.target === parent) D.removeClass(buttons, 'hidden');
163 }, true);
164 parent.addEventListener('mouseleave', function(ev){
165 if(ev.target === parent) D.addClass(buttons, 'hidden');
166 }, true);
167 /* mouseenter/leave work well... but only if there's a mouse. */
168 }
169 parent.addEventListener('click', function(ev){
170 ev.preventDefault();
171 ev.stopPropagation();
172 D.toggleClass(buttons, 'hidden');
173 }, false);
174

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button