Last active
August 29, 2015 14:27
-
-
Save bjoerntx/8649c53f5e0b08482eed to your computer and use it in GitHub Desktop.
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
<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