From 411ed26a25d5e63ba8a4566e52282f74d2a63aef Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 18 Sep 2015 22:02:45 +0300 Subject: [PATCH] added options... Signed-off-by: Alex A. Naanou --- ui (gen4)/lib/widget/drawer.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ui (gen4)/lib/widget/drawer.js b/ui (gen4)/lib/widget/drawer.js index 2761986b..5c2650c3 100755 --- a/ui (gen4)/lib/widget/drawer.js +++ b/ui (gen4)/lib/widget/drawer.js @@ -41,6 +41,10 @@ var OverlayPrototype = { client: null, options: { + 'close-at': 10, + 'fade-at': 100, + 'animate': 120, + nonPropagatedEvents: [ 'click', 'keydown', @@ -78,7 +82,7 @@ var OverlayPrototype = { opacity: 0, filter: 'none', }, - 120, + this.options['animate'], function(){ that.dom.detach() if(that.parent.children('.overlay-widget').length == 0){ @@ -127,14 +131,15 @@ var OverlayPrototype = { client_dom.outerHeight(), // do not scroll more than the container height and // keep a bit on top... - (parent.is('body') ? $(document) : parent).outerHeight()-100)+'px', + (parent.is('body') ? $(document) : parent) + .outerHeight()-options['fade-at'])+'px', opacity: 1, }, - 120, + options['animate'], function(){ dom.scroll(function(){ var st = $(this).scrollTop() - var h = Math.min(100, client_dom.outerHeight()) + var h = Math.min(options['fade-at'], client_dom.outerHeight()) // start fading... if(st < h){ dom.css({ opacity: Math.min(1, st/h) }) @@ -142,7 +147,7 @@ var OverlayPrototype = { dom.css('opacity', 1) } // close drawer when scrolling to the top... - if(st < 10){ + if(st < options['close-at']){ that.close() } })