Skip to content

Instantly share code, notes, and snippets.

@vinassefranche
Created June 24, 2021 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vinassefranche/bd4e374c17f13e3a6f879facb2d9c8c2 to your computer and use it in GitHub Desktop.
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
(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