I'm having issues with identifying the parent of one of my child nodes . code is as follows
if (!queryCommandState('InsertUnorderedList')
&& !queryCommandState('InsertOrderedList')) {
// If forced_root_blocks is set to false we don't have a block to indent so lets create a div
if (!settings.forced_root_block
&& !dom.getParent(selection.getNode(), dom.isBlock)) {
formatter.apply('div');
}
each(selection.getSelectedBlocks(), function(element) {
var indentStyleName;
if (element.nodeName != "LI") {
indentStyleName = dom.getStyle(element, 'direction', true) == 'rtl' ? 'paddingRight' : 'paddingLeft';
if (command == 'outdent') {
value = Math.max(0, parseInt(element.style[indentStyleName] || 0, 10) - intentValue);
dom.setStyle(element, indentStyleName, value ? value + indentUnit : '');
} else {
value = (parseInt(element.style[indentStyleName] || 0, 10) + intentValue) + indentUnit;
dom.setStyle(element, indentStyleName, value);
}
}
if (element.nodeName=== "OL"){
alert ("got");
} else {
alert (element.nodeName);
}
});
}
- want to find the parent of the "element.nodeName"*