mirror of
				https://github.com/TitanEmbeds/Titan.git
				synced 2025-11-04 07:47:10 +01:00 
			
		
		
		
	Allow selection to chatcontent despite focusing on messagebox
This commit is contained in:
		@@ -51,6 +51,7 @@
 | 
				
			|||||||
    var display_richembeds; // true/false - if rich embeds should be displayed
 | 
					    var display_richembeds; // true/false - if rich embeds should be displayed
 | 
				
			||||||
    var guild_roles_list = []; // List of all guild roles
 | 
					    var guild_roles_list = []; // List of all guild roles
 | 
				
			||||||
    var all_users = []; // List of all the users in guild
 | 
					    var all_users = []; // List of all the users in guild
 | 
				
			||||||
 | 
					    var is_dragging_chatcontainer = false; // Track if is dragging on chatcontainer (does not trigger messagebox focus) or not
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    function element_in_view(element, fullyInView) {
 | 
					    function element_in_view(element, fullyInView) {
 | 
				
			||||||
        var pageTop = $(window).scrollTop();
 | 
					        var pageTop = $(window).scrollTop();
 | 
				
			||||||
@@ -311,11 +312,21 @@
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        $("#chatcontent").click(function () {
 | 
					        $("#chatcontent")
 | 
				
			||||||
            if (!$('#messagebox').prop('disabled')) {
 | 
					            .mousedown(function () {
 | 
				
			||||||
                $("#messagebox").focus();
 | 
					                $(window).mousemove(function() {
 | 
				
			||||||
            }
 | 
					                    is_dragging_chatcontainer = true;
 | 
				
			||||||
        });
 | 
					                    $(window).unbind("mousemove");
 | 
				
			||||||
 | 
					                });
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
 | 
					            .mouseup(function () {
 | 
				
			||||||
 | 
					                var wasDragging = is_dragging_chatcontainer;
 | 
				
			||||||
 | 
					                is_dragging_chatcontainer = false;
 | 
				
			||||||
 | 
					                $(window).unbind("mousemove");
 | 
				
			||||||
 | 
					                if (!wasDragging) {
 | 
				
			||||||
 | 
					                    $("#messagebox").focus();
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        if (disabled) {
 | 
					        if (disabled) {
 | 
				
			||||||
            Materialize.toast('This server is currently disabled. If you are an administrator of this server, please get in touch with a TitanEmbeds team member to lift the ban.', 100000);
 | 
					            Materialize.toast('This server is currently disabled. If you are an administrator of this server, please get in touch with a TitanEmbeds team member to lift the ban.', 100000);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user