Created
June 24, 2021 13:55
-
-
Save vinassefranche/bd4e374c17f13e3a6f879facb2d9c8c2 to your computer and use it in GitHub Desktop.
Snippet that move the bubble create field button on top of the page and increases the width of the input storing the database fields' name
This file contains 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
(function(){ | |
const moveButton = () => { | |
var container = document | |
.getElementsByClassName('tab-panel data types opened')[0] | |
.getElementsByClassName('right-pane-inner')[0]; | |
var button = container.getElementsByClassName('add-new-type')[0]; | |
var allfields = container.getElementsByClassName('custom-fields')[0]; | |
button.parentNode.insertBefore(button, allfields); | |
}; | |
const increaseInputWidth = () => { | |
$('input.property-editor-control.TextBox:not(.empty)').css('width', 500) | |
}; | |
moveButton(); | |
increaseInputWidth(); | |
$('input.property-editor-control.TextBox:not(.empty)').css('width', 500); | |
let onClickSet = false; | |
const interval = setInterval(() => { | |
const createButtons = document.getElementsByClassName('btn btn-create bubble-ui'); | |
if(createButtons.length) { | |
if(!onClickSet) { | |
onClickSet = true; | |
createButtons[0].onclick = () => { | |
setTimeout(() => { | |
increaseInputWidth(); | |
moveButton(); | |
}, 1000); | |
}; | |
} | |
} else if(onClickSet) { | |
onClickSet = false; | |
} | |
}, 100); | |
})(); | |
// minified | |
(function(){const moveButton=()=>{var container=document.getElementsByClassName('tab-panel data types opened')[0].getElementsByClassName('right-pane-inner')[0];var button=container.getElementsByClassName('add-new-type')[0];var allfields=container.getElementsByClassName('custom-fields')[0];button.parentNode.insertBefore(button,allfields)};const increaseInputWidth=()=>{$('input.property-editor-control.TextBox:not(.empty)').css('width',500)};moveButton();increaseInputWidth();$('input.property-editor-control.TextBox:not(.empty)').css('width',500);let onClickSet=false;const interval=setInterval(()=>{const createButtons=document.getElementsByClassName('btn btn-create bubble-ui');if(createButtons.length){if(!onClickSet){onClickSet=true;createButtons[0].onclick=()=>{setTimeout(()=>{increaseInputWidth();moveButton()},1000)}}}else if(onClickSet){onClickSet=false}},100)})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment