Disable master after dropping on page

Started by Miki, June 17, 2015, 11:14:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Miki

Hello,
I want to create a master in a stencil where once I drop the master on the page, it will be disabled in the stencil.
For e.g.: If I have a master called "ShapeTest" and when I drag and drop it on the drawing, it will disable itself in the stencil (not on the page). So I want only one instance of that shape to be on the drawing.
Is it possible to do this via "EventDrop" or by some other mean?

Any help is appreciated.

Thanks,
-Miki

Surrogate

Quote from: Miki on June 17, 2015, 11:14:23 PMI want to create a master in a stencil where once I drop the master on the page, it will be disabled in the stencil.
You want hide master in document stencil or protect by drop ?
May be hide second and other instance of that shape to be on the drawing, only first instance can be visible ?

AndyW

You would need to do something with the shape added event. When the shape is added, check to see if one already exists on the page (or all pages) and if so delete it. Disabling it in you stencil would not stop someone copy and pasting it on the diagram, so shape added is the way to go.
Live life with an open mind

Yacine

Yacine

Browser ID: smf (is_webkit)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 195 (show)
Files included: 32 - 1216KB. (show)
Memory used: 1087KB.
Tokens: post-login.
Cache hits: 12: 0.00197s for 26,582 bytes (show)
Cache misses: 1: (show)
Queries used: 18.

[Show Queries]