소스 검색

Merge pull request #79 from fbencosme/patch-2

Fix 'TypeError' on destroy
Jay Salvat 10 년 전
부모
커밋
d433f87d0c
1개의 변경된 파일6개의 추가작업 그리고 3개의 파일을 삭제
  1. 6 3
      src/vegas.js

+ 6 - 3
src/vegas.js

@@ -614,9 +614,12 @@
             this.$elmt.find('> .vegas-slide').remove();
             this.$elmt.find('> .vegas-wrapper').clone(true).children().appendTo(this.$elmt);
             this.$elmt.find('> .vegas-wrapper').remove();
-            this.$timer.remove();
-            this.$overlay.remove();
-
+            if (this.settings.timer) {
+              this.$timer.remove();    
+            }
+            if (this.settings.overlay) {
+              this.$overlay.remove();    
+            }
             this.elmt._vegas = null;
         }
     };