Просмотр исходного кода

Fixing nicescroll visibility inside Modal

Due to check at line 1898, the nicescroll was being hidden inside a modal.
Added check if the nice scroll element is inside a modal, in that case the nice scroll should not be hidden.
Abhishek Singh 9 лет назад
Родитель
Сommit
c4b3f68e54
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      jquery.nicescroll.js

+ 2 - 2
jquery.nicescroll.js

@@ -1895,7 +1895,7 @@
           self.observerbody = new ClsMutationObserver(function(mutations) {
             mutations.forEach(function(mut){
               if (mut.type=="attributes") {
-                return ($("body").hasClass("modal-open")) ? self.hide() : self.show();  // Support for Bootstrap modal
+                return ($("body").hasClass("modal-open") && !$.contains($('.modal-dialog')[0],self.doc[0])) ? self.hide() : self.show();  // Support for Bootstrap modal; Added check if the nice scroll element is inside a modal
               }
             });  
             if (document.body.scrollHeight!=self.page.maxh) return self.lazyResize(30);
@@ -3631,4 +3631,4 @@
     $.nicescroll.options = _globaloptions;
   }
 
-}));
+}));