]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Tweak fix javascript type error on pages without sidebar
authorMarcin Haba <marcin.haba@bacula.pl>
Sat, 7 Dec 2019 11:07:08 +0000 (12:07 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Tue, 17 Dec 2019 17:18:40 +0000 (18:18 +0100)
gui/baculum/protected/Web/JavaScript/misc.js

index 473528679f6bb37b0189589e5848f8679833e318..25521d4c0170d8e710b9deba94e1a94e919b2e7c 100644 (file)
@@ -782,14 +782,16 @@ var W3SideBar = {
                this.set_events();
        },
        set_events: function() {
-               this.sidebar.addEventListener('touchstart', handle_touch_start);
-               this.sidebar.addEventListener('touchmove', function(e) {
-                       handle_touch_move(e, {
-                               'swipe_left': function() {
-                                       this.close();
-                               }.bind(this)
-                       });
-               }.bind(this));
+               if (this.sidebar) {
+                       this.sidebar.addEventListener('touchstart', handle_touch_start);
+                       this.sidebar.addEventListener('touchmove', function(e) {
+                               handle_touch_move(e, {
+                                       'swipe_left': function() {
+                                               this.close();
+                                       }.bind(this)
+                               });
+                       }.bind(this));
+               }
        },
        open: function() {
                if (this.sidebar.style.display === 'block' || this.sidebar.style.display === '') {