From 502b4c9dcdc2e5c7e82c608f0091b419287525d2 Mon Sep 17 00:00:00 2001 From: Wassup789 Date: Sat, 18 Nov 2017 00:20:11 -0800 Subject: [PATCH] Fixed bug for legacy layout button display --- js/content_script.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/js/content_script.js b/js/content_script.js index b51bdd6..03d5bf3 100644 --- a/js/content_script.js +++ b/js/content_script.js @@ -215,19 +215,21 @@ function launchLegacy(){ } }else if($(".ytn-btn").length < 1){// For everything else $(".yt-uix-overlay").each(function(){ + var $this = $(this); if( - $(this).hasClass("channel-settings-overlay") || - $(this).hasClass("featured-content-picker-overlay") || - $(this).hasClass("settings-dialog-container") || + $this.hasClass("channel-settings-overlay") || + $this.hasClass("featured-content-picker-overlay") || + $this.hasClass("settings-dialog-container") || $(".about-metadata-container").find(this).length > 0 || - $(this).parent().hasClass("channel-header-flagging-menu-container")) + $this.parent().hasClass("channel-header-flagging-menu-container") || + $this.parents(".primary-header-actions").find(".ytn-btn").length > 0) return; else{ - if($(".primary-header-actions").find(this).length > 0){ + if($this.parents(".primary-header-actions").length > 0){ var elem2 = elem.replace("float: initial", "float: right"); - $(".primary-header-actions").prepend(elem2); + $this.parents(".primary-header-actions").prepend(elem2); }else - $(elem).insertBefore($(this)); + $(elem).insertBefore($this); } });