Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Last active August 29, 2015 14:27
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 bjoerntx/8649c53f5e0b08482eed to your computer and use it in GitHub Desktop.
Save bjoerntx/8649c53f5e0b08482eed to your computer and use it in GitHub Desktop.
<script>
// wait until the complete ribbon is loaded
TXTextControl.addEventListener("ribbonTabsLoaded", function (e) {
attachEvents();
});
function attachEvents() {
// store the parent element
var parent = $("#tglBtnPreviewMergeResults").parent();
// clone and append the element to the parent
$("#tglBtnPreviewMergeResults").clone().appendTo(parent);
// remove the old element
$("#tglBtnPreviewMergeResults").remove();
// rewire required events
$(document).on("click", "#tglBtnPreviewMergeResults",
function () {
alert("Custom Preview");
});
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment