Skip to content

Instantly share code, notes, and snippets.

@UlisesGascon
Last active April 9, 2018 13:01
Show Gist options
  • Save UlisesGascon/ac20ddf2edca805f5215454779b325b6 to your computer and use it in GitHub Desktop.
Save UlisesGascon/ac20ddf2edca805f5215454779b325b6 to your computer and use it in GitHub Desktop.
Just another little hack for friends ^^
$( 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