Merge branch 'ticket-12563-TrustedBadge' into develop
This commit is contained in:
commit
db9a22da22
@ -21,11 +21,30 @@
|
||||
var __ts = document.getElementsByTagName('script')[0];
|
||||
__ts.parentNode.insertBefore(_ts, __ts);
|
||||
})();
|
||||
function onElementInserted(containerSelector, elementSelector, callback) {
|
||||
var onMutationsObserved = function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
if (mutation.addedNodes.length) {
|
||||
var elements = $(mutation.addedNodes).find(elementSelector);
|
||||
for (var i = 0, len = elements.length; i < len; i++) {
|
||||
callback(elements[i]);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var target = $(containerSelector)[0];
|
||||
var config = { childList: true, subtree: true };
|
||||
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
|
||||
var observer = new MutationObserver(onMutationsObserved);
|
||||
observer.observe(target, config);
|
||||
|
||||
}
|
||||
$(document).ready(function(){
|
||||
setTimeout(function(){
|
||||
onElementInserted('#customCheckoutDiv2', 'div', function(element) {
|
||||
$('#customCheckoutDiv2 div[id^=\'tsbadge_\']').css('width','200px');
|
||||
$('#customCheckoutDiv2 div[id^=\'tsCustomBadge\']').css('width','200px');
|
||||
},1200);
|
||||
});
|
||||
});
|
||||
{/literal}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user