Last active
April 9, 2018 13:01
-
-
Save UlisesGascon/ac20ddf2edca805f5215454779b325b6 to your computer and use it in GitHub Desktop.
Just another little hack for friends ^^
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$( document ).ready(function() { | |
$("#ui-id-3").on("click", function(){ | |
console.log("Fase 1") | |
setTimeout(function() { | |
console.log("Fase 2") | |
// DOM Selectors | |
var inputSelector = document.getElementById("searchbox"); | |
var canvasSelector = document.getElementById("graph_canvas_0"); | |
// Function to blur the focus | |
function magicBlur() { | |
inputSelector.blur(); | |
} | |
function hiddeElement(selector) { | |
if(selector && selector.style){ | |
selector.style.display = "none"; | |
} | |
} | |
//---- User Events | |
// Event: Press enter reaction | |
inputSelector.addEventListener('keyup', function(e) { | |
if (e.keyCode === 13) { | |
inputSelector.blur(); | |
} | |
}); | |
// Event: touch the Canvas | |
canvasSelector.addEventListener('touchstart', magicBlur); | |
// Event: Click on the Canvas | |
canvasSelector.addEventListener('click', magicBlur); | |
//--- We hidde things from the user view in order to avoid interaction | |
hiddeElement(document.querySelector(".crisp-client")) | |
hiddeElement(document.querySelector("#graph_box > div.graph_content.maximized > div.controls.control-vertical > div:nth-child(2)")) | |
hiddeElement(document.querySelector("#graph_box > div.graph_content.maximized > div.controls.control-vertical > div:nth-child(3)")) | |
hiddeElement(document.getElementById("ui-id-1")) | |
hiddeElement(document.querySelector(".controls .control-vertical")) | |
}, 1000); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment