I am trying to modify the indent tool to use a left padded div instead of a blockquote. I understand that the RADEditor uses execCommand that is provided by the browser, but I am trying to override this so that I can use a padded div instead of the browsers implementation.
I am using the OnClientCommandExecuting event in the RADEditor with the following JavaScript, which isn't working exactly as I thought it would. Any help would be greatly appreciated!
Regards,
Neil
I am using the OnClientCommandExecuting event in the RADEditor with the following JavaScript, which isn't working exactly as I thought it would. Any help would be greatly appreciated!
Regards,
Neil
function OnClientCommandExecuting(editor, args) {
var commandName = args.get_commandName();
var editorParentSelection = editor.getSelection().getParentElement();
switch (commandName) {
case "Indent":
var editorParentSelection = editor.getSelection().getParentElement();
var currentSelection = editor.getSelection().getRange();
var wrapper = document.createElement("div");
wrapper.setAttribute("style", "margin-left: 30px");
wrapper.innerHTML = currentSelection.endContainer.textContent;
output = $telerik.getOuterHtml(wrapper);
editor.pasteHtml(output);
console.log(editorParentSelection.outerHTML);
args.set_cancel(true);
break;
case "Outdent":
editorParentSelection.outerHTML;
break;
default:
break;
}
}