Skip to content

Commit

Permalink
Minor: Small behavior change for invisible sidebar switch trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
fofajardo committed Dec 10, 2017
1 parent 95846c2 commit 8b0466a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions content/aios_old.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,7 @@ function aios_autoShowHide(mode) {
=> aios_initSidebar() adds a mouse-move event to the "appcontent" object, ...
=> this event calls this function
*/
var aios_invCursorTZ = false;
var aios_invTimeout;
var aios_invCursorTZ = false, aios_invTimeout, savedPos;
function aios_invisibleTrigger(mode) {
var autobutton = aios_getBoolean('aios-enableAutohide', 'checked');

Expand All @@ -552,15 +551,18 @@ function aios_invisibleTrigger(mode) {
if (!aios_isSidebarHidden() && (hidemethod == 1 || hidemethod == 3)) return false;

var rightWidth = fx_browser.boxObject.width - invWidth;

savedPos = mode.clientX;
//console.log('savepos: ' + savedPos + ',clientX: ' + mode.clientX + ', rightWidth: ' + rightWidth);
if (((mode.clientX <= invWidth) && orient == 1 || (mode.clientX >= rightWidth) && orient == 2) && !aios_invCursorTZ)
{
// I am in trigger zone
aios_invCursorTZ = true;

// Show/hide after a certain time
aios_invTimeout = window.setTimeout(function() {
aios_toggleSidebar('switch');
if ((savedPos <= invWidth) && orient == 1 || (savedPos >= rightWidth) && orient == 2) {
aios_toggleSidebar('switch');
}
aios_invCursorTZ = false;
}, delay);

Expand Down

0 comments on commit 8b0466a

Please sign in to comment.