WPCubed Product Support

textobject and protected paragraph

Hi;

I am inserting a type wpobjHorizontalLine text object, and I am protecting the whole paragraph so editing is posible on it (as Julian suggested me).

But I see that, even if paragraph is protected, the object can be selected (by clicking) and then deleted.

That, is not bad for me, if I also can delete the parent paragraph too. Otherwise, it will be an empty/protected paragraph into the text, and I think it is not so good.

How can I tell WP to delete this paragraph too, when the object is deleted?.

Thank you.

Felipe

#1 ♥ 0
4.2k Views 2 users read 1 min
support

Hi,

You can trap the VK_Delete key in OnKeyPressDown and check if you have a selected object. If that is a horizontal line you can delete the paragraph.

YOu can check for a selected object using WP.selectedObject

#2 ♥ 0
This category is archived. No new posts are possible.