]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix scrutinizer issues
authorJan-Christoph Borchardt <hey@jancborchardt.net>
Fri, 27 Mar 2015 08:37:52 +0000 (09:37 +0100)
committerJan-Christoph Borchardt <hey@jancborchardt.net>
Fri, 27 Mar 2015 08:38:41 +0000 (09:38 +0100)
core/js/js.js

index 26eac9c01a8963d177b106d5d6cfc60f25a63542..274eddffff760cbf738bec2de354522e7386d977 100644 (file)
@@ -1264,18 +1264,19 @@ function initCore() {
                // adjust controls bar width
                var adjustControlsWidth = function() {
                        if($('#controls').length) {
+                               var controlsWidth;
                                // if there is a scrollbar …
                                if($('#app-content').get(0).scrollHeight > $('#app-content').height()) {
                                        if($(window).width() > 768) {
-                                               var controlsWidth = $('#content').width() - $('#app-navigation').width() - getScrollBarWidth();
+                                               controlsWidth = $('#content').width() - $('#app-navigation').width() - getScrollBarWidth();
                                        } else {
-                                               var controlsWidth = $('#content').width() - getScrollBarWidth();
+                                               controlsWidth = $('#content').width() - getScrollBarWidth();
                                        }
                                } else { // if there is none
                                        if($(window).width() > 768) {
-                                               var controlsWidth = $('#content').width() - $('#app-navigation').width();
+                                               controlsWidth = $('#content').width() - $('#app-navigation').width();
                                        } else {
-                                               var controlsWidth = $('#content').width();
+                                               controlsWidth = $('#content').width();
                                        }
                                }
                                $('#controls').css('width', controlsWidth);
@@ -1731,9 +1732,11 @@ function getScrollBarWidth() {
        var w1 = inner.offsetWidth;
        outer.style.overflow = 'scroll';
        var w2 = inner.offsetWidth;
-       if (w1 == w2) w2 = outer.clientWidth;
+       if(w1 === w2) {
+               w2 = outer.clientWidth;
+       }
 
        document.body.removeChild (outer);
 
        return (w1 - w2);
-};
+}