Browse Source

#1933, more optimizations for sidebar

pull/2034/head
jlukic 9 years ago
parent
commit
243243a78a
1 changed files with 12 additions and 9 deletions
  1. 21
      src/definitions/modules/sidebar.js

21
src/definitions/modules/sidebar.js

@ -474,6 +474,7 @@ $.fn.sidebar = function(parameters) {
? $module
: $pusher,
animate,
dim,
transitionEnd
;
callback = $.isFunction(callback)
@ -490,11 +491,9 @@ $.fn.sidebar = function(parameters) {
module.add.bodyCSS();
module.set.animating();
module.set.visible();
if(!module.othersVisible()) {
if(settings.dimPage) {
$pusher.addClass(className.dimmed);
}
}
};
dim = function() {
module.set.dimmed();
};
transitionEnd = function(event) {
if( event.target == $transition[0] ) {
@ -507,6 +506,9 @@ $.fn.sidebar = function(parameters) {
$transition.off(transitionEvent + elementNamespace);
$transition.on(transitionEvent + elementNamespace, transitionEnd);
requestAnimationFrame(animate);
if(settings.dimPage && !module.othersVisible()) {
requestAnimationFrame(dim);
}
},
pullPage: function(callback) {
@ -635,10 +637,6 @@ $.fn.sidebar = function(parameters) {
$html.addClass(className.ios);
},
dimmed: function() {
$pusher.addClass(className.dimmed);
},
// container
pushed: function() {
$context.addClass(className.pushed);
@ -647,6 +645,11 @@ $.fn.sidebar = function(parameters) {
$context.addClass(className.pushable);
},
// pusher
dimmed: function() {
$pusher.addClass(className.dimmed);
},
// sidebar
active: function() {
$module.addClass(className.active);

Loading…
Cancel
Save