From 8cd61d9594ce267d45893ef97eeeadb972363a80 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 4 Mar 2016 18:09:41 +0300 Subject: [PATCH] experemental feature to hide cursor on navigation -- not working for some reason and commented out... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/ui.js | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/ui (gen4)/features/ui.js b/ui (gen4)/features/ui.js index 1184e8be..c62e2c6f 100755 --- a/ui (gen4)/features/ui.js +++ b/ui (gen4)/features/ui.js @@ -1060,12 +1060,14 @@ module.Clickable = core.ImageGridFeatures.Feature({ //--------------------------------------------------------------------- +// Auto-hide cursor... // NOTE: removing the prop 'cursor-autohide' will stop hiding the cursor // and show it on next timeout/mousemove. // This will not stop watching the cursor, this setting the prop back // on will re-enable autohide. // XXX needs testing... +// NOTE: chrome 49 + devtools open appears to prevent the cursor from being hidden... var AutoHideCursor = module.AutoHideCursor = core.ImageGridFeatures.Feature({ title: '', @@ -1158,7 +1160,10 @@ module.AutoHideCursor = core.ImageGridFeatures.Feature({ // This will store/restore autohide state for single-image and ribbon // views... -// XXX might be a good idea to hide cursor on navigation in autohide mode... +// +// NOTE: chrome 49 + devtools open appears to prevent the cursor from being hidden... +// +// XXX hiding cursor on navigation for some reason does not work... var AutoHideCursorSingleImage = module.AutoHideCursorSingleImage = core.ImageGridFeatures.Feature({ title: '', @@ -1173,6 +1178,8 @@ module.AutoHideCursorSingleImage = core.ImageGridFeatures.Feature({ config: { 'cursor-autohide-single-image-view': 'on', 'cursor-autohide-ribbon-view': 'off', + + //'cursor-autohide-on-navigate': true, }, handlers: [ @@ -1203,7 +1210,23 @@ module.AutoHideCursorSingleImage = core.ImageGridFeatures.Feature({ } else { this.toggleAutoHideCursor(this.config['cursor-autohide-ribbon-view']) } - }] + }], + /* XXX for some reason this does not work... + // autohide on navigation... + ['focusImage', + function(){ + //if(this.config['cursor-autohide-on-navigate'] + // && this.toggleAutoHideCursor('?') == 'on'){ + // this.toggleAutoHideCursor('on') + //} + if(this.config['cursor-autohide-on-navigate'] + && this.toggleAutoHideCursor('?') == 'on' + && this.ribbons.viewer.prop('cursor-autohide')){ + this.ribbons.viewer + .addClass('cursor-hidden') + } + }], + */ ] })